Shape-Indexed Tensors #
Tensor construction, shape operations, runtime conversion, and executable tensor operators.
Low-level executable ops for verification and compiler-facing examples.
Most model code should use nn.* and Trainer.*. Use Ops.* when writing an explicit
TorchLean executable program directly, for example before compiling a hand-built fragment to
NN.IR.Graph.
Construct a shape from its outermost-to-innermost dimensions.
Instances For
Flatten each sample in a batch and retain its first takeDim entries.
The proof hTake rules out truncation beyond the flattened source shape, so the result has the
statically known shape batch × takeDim.
Instances For
Construct a fixed-length vector from an array.
Entries beyond the array use fallback; entries beyond length n are ignored. This constructor is
useful at runtime data boundaries where the tensor length is fixed by a model type while the source
array is checked or padded by the caller.
Instances For
Public shorthand for TorchLean's shape-indexed tensor family.
Instances For
Construct a tensor from a flat list of Float values and convert each entry to the selected scalar
type. The list length must equal the product of dims.
Instances For
Repeat one tensor across a fixed batch axis.
Use this for classifier demos whose checked model consumes a whole batch, while the example wants to inspect one ordinary input.
Instances For
Convert a runtime tensor back to a Float tensor inside IO.
Trainer prediction handles use this so examples can train under executable IEEE32 or another scalar
backend, then inspect ordinary Float tensors afterward.
Instances For
Related Namespaces #
Model construction, training, runtime selection, and verification live in their corresponding
TorchLean namespaces.