Custom operations on tensors #
Inputs use the public Arguments container for shape-indexed tensors. The pure evaluator uses
checked row-major reads and stops at the first failure. Native execution transfers complete scalar
words; byte arrays remain an implementation detail of the LibTorch bridge.
Read tensor arguments by operand number and row-major unsigned index.
The shape determines the bounds, without materializing an intermediate array. Invalid operand numbers and invalid addresses retain their distinct error diagnostics.
Instances For
Tensor argument reads use the emitted unsigned bounds condition when the native length agrees with the tensor shape and in-bounds native loads agree with its entries.
The premises identify the buffer metadata and contents; they do not assert that a foreign memory implementation satisfies them. Out-of-bounds loads need no value because that branch never loads.
Evaluate a custom operation once per output entry, retaining the requested tensor shape.
All output indices must fit the expression language's unsigned addressing. An empty output makes no reads. Input failures stop construction in increasing output-index order.
Instances For
Tensor evaluation agrees with the original source function at every output index.
The equality includes read failures and output-size rejection, not just successful tensors.
Execute a custom operation on the selected device, retaining the requested output shape.
CPU uses the Lean evaluator; GPU uses generated CUDA. A format outside the GPU implementation's limits uses the same Lean evaluator with a diagnostic, without changing precision. Other devices and operational failures are rejected. Native execution remains an external trust boundary.