package/@greenpandastudios/aug-pytorch@0.2.0/api.aug diagrams
Project overview · Compiled explanation
Class interactions
Mermaid source
flowchart TD
n0["_TensorContainer"]
n1["_TensorHolder"]
n2["sum"]
n3["Tensor"]
n1 -->|"implements"| n0
n1 -->|"calls"| n2
n1 -->|"holds item"| n3
Sequences
Call arrows identify checked targets; loop and branch frames determine when they run. Open that target’s module to follow its implementation. Branches describe alternatives; loops describe repeated work. Native calls and interface dispatch stop at their declared contracts. Exit notes end that path; enclosing recovery and cleanup remain visible.
_tensor
It is private to its defining scope.
It takes values as List<float>.
It returns ownership of Tensor. Failures can raise TensorError.
Native implementation: @greenpandastudios/aug-pytorch@0.2.0, 2.14.1. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: native.abi.json (SHA-256 f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5). It calls aug_torch_tensor_from_f64_v1 through the C ABI on the caller thread; a blocking native call blocks that thread. The caller owns the returned handle. Its contract does not permit worker entry. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
May leave with checked errors: TensorError. Native implementation; only the declared contract is known. Explanation.
_add
It is private to its defining scope.
It takes left and right as Tensor.
It returns ownership of Tensor. Failures can raise TensorError.
Native implementation: @greenpandastudios/aug-pytorch@0.2.0, 2.14.1. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: native.abi.json (SHA-256 f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5). It calls aug_torch_tensor_add_v1 through the C ABI on the caller thread; a blocking native call blocks that thread. left lends read access for this call; right lends read access for this call. The caller owns the returned handle. Its contract does not permit worker entry. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
May leave with checked errors: TensorError. Native implementation; only the declared contract is known. Explanation.
_sum
It is private to its defining scope.
It takes tensor as Tensor.
It returns float. Failures can raise TensorError.
Native implementation: @greenpandastudios/aug-pytorch@0.2.0, 2.14.1. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: native.abi.json (SHA-256 f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5). It calls aug_torch_tensor_sum_v1 through the C ABI on the caller thread; a blocking native call blocks that thread. tensor lends read access for this call. Its contract does not permit worker entry. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
May leave with checked errors: TensorError. Native implementation; only the declared contract is known. Explanation.
_values
It is private to its defining scope.
It takes tensor as Tensor.
It returns List<float>. Failures can raise TensorError.
Native implementation: @greenpandastudios/aug-pytorch@0.2.0, 2.14.1. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: native.abi.json (SHA-256 f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5). It calls aug_torch_tensor_values_v1 through the C ABI on the caller thread; a blocking native call blocks that thread. tensor lends read access for this call. August copies the returned buffer, then calls aug_torch_values_release_v1 to release it. Its contract does not permit worker entry. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
May leave with checked errors: TensorError. Native implementation; only the declared contract is known. Explanation.
tensor
Copy a list of float64 values into a CPU tensor.
It takes values as List<float>.
It returns ownership of Tensor. Failures can raise TensorError.
Mermaid source
sequenceDiagram
participant p0 as tensor
rect rgb(245, 240, 241)
Note over p0: Enter unsafe scope
p0->>p0: _tensor(values=values) · native boundary
p0-->>p0: _tensor result: Tensor
Note over p0: Return _tensor(values); required cleanup runs before<br/>exit
Note over p0: Leave unsafe scope
end
Note over p0: May leave with checked errors: TensorError
add
Add tensors without changing either input.
It takes left and right as Tensor.
It returns ownership of Tensor. Failures can raise TensorError.
Mermaid source
sequenceDiagram
participant p0 as add
rect rgb(245, 240, 241)
Note over p0: Enter unsafe scope
p0->>p0: _add(left=left, right=right) · native boundary
p0-->>p0: _add result: Tensor
Note over p0: Return _add(left, right); required cleanup runs before<br/>exit
Note over p0: Leave unsafe scope
end
Note over p0: May leave with checked errors: TensorError
sum
Sum every element.
It takes tensor as Tensor.
Failures can raise TensorError.
Mermaid source
sequenceDiagram
participant p0 as sum
rect rgb(245, 240, 241)
Note over p0: Enter unsafe scope
p0->>p0: _sum(tensor=tensor) · native boundary
p0-->>p0: _sum result: float
Note over p0: Return _sum(tensor); required cleanup runs before exit
Note over p0: Leave unsafe scope
end
Note over p0: May leave with checked errors: TensorError
values
Copy tensor values into an August list.
It takes tensor as Tensor.
Failures can raise TensorError.
Mermaid source
sequenceDiagram
participant p0 as values
rect rgb(245, 240, 241)
Note over p0: Enter unsafe scope
p0->>p0: _values(tensor=tensor) · native boundary
p0-->>p0: _values result: List‹float›
Note over p0: Return _values(tensor); required cleanup runs before<br/>exit
Note over p0: Leave unsafe scope
end
Note over p0: May leave with checked errors: TensorError
_liveTensors
It is private to its defining scope.
It returns int.
Native implementation: @greenpandastudios/aug-pytorch@0.2.0, 2.14.1. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: native.abi.json (SHA-256 f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5). It calls aug_probe_live_tensors_v1 through the C ABI on the caller thread; a blocking native call blocks that thread. Its contract does not permit worker entry. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
Native implementation; only the declared contract is known. Explanation.
_liveBuffers
It is private to its defining scope.
It returns int.
Native implementation: @greenpandastudios/aug-pytorch@0.2.0, 2.14.1. Supported targets: linux arm64 glibc 2.36+ itanium-cxx11, linux x64 glibc 2.36+ itanium-cxx11, macos arm64 14.0+ apple-libc++. Binding contract: native.abi.json (SHA-256 f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5). It calls aug_probe_live_buffers_v1 through the C ABI on the caller thread; a blocking native call blocks that thread. Its contract does not permit worker entry. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
Native implementation; only the declared contract is known. Explanation.
_consumeAndFail
It is private to its defining scope.
It takes value as Tensor with ownership transferred.
Failures can raise TensorError.
Mermaid source
sequenceDiagram
participant p0 as _consumeAndFail
p0->>p0: TensorError(code=99, message=”expected cleanup test”) ·<br/>construct value
p0-->>p0: TensorError result: TensorError
Note over p0: Raise checked failure TensorError(code=99,<br/>message=”expected cleanup test”); required cleanup runs<br/>before exit
Note over p0: May leave with checked errors: TensorError
_TensorContainer.total
It returns float. Failures can raise TensorError.
May leave with checked errors: TensorError. Interface contract; implementation selected at runtime. Explanation.
_TensorHolder constructor
It implements _TensorContainer. It is private to this file.
It takes item as Tensor with ownership transferred, kept mutable.
Receive fields: item. Explanation.
_TensorHolder.total
Failures can raise TensorError.
Mermaid source
sequenceDiagram
participant p0 as _TensorHolder.total
p0->>p0: sum(tensor=item)
p0-->>p0: sum result: float
Note over p0: Return sum(tensor=item); required cleanup runs before<br/>exit
Note over p0: May leave with checked errors: TensorError
_replace
It is private to its defining scope.
It takes holder as _TensorHolder with permission to mutate it during the call and replacement as Tensor with ownership transferred.
It may change holder.
Set holder.item to replacement. Explanation.
Called contracts
- _TensorContainer — package/@greenpandastudios/aug-pytorch@0.2.0/api.aug
- _add — package/@greenpandastudios/aug-pytorch@0.2.0/api.aug
- _sum — package/@greenpandastudios/aug-pytorch@0.2.0/api.aug
- _tensor — package/@greenpandastudios/aug-pytorch@0.2.0/api.aug
- _values — package/@greenpandastudios/aug-pytorch@0.2.0/api.aug
- sum — package/@greenpandastudios/aug-pytorch@0.2.0/api.aug
- TensorError — package/@greenpandastudios/aug-pytorch@0.2.0/contracts.aug