Tensor Shape-Erasure Boundary #
Conversions between statically shape-indexed TensorPack values and arrays of existentially
packaged Spec.SomeTensor values. Runtime tapes and heterogeneous external data use the erased
representation; typed computation should recover a TensorPack immediately after crossing that
boundary.
Erase the individual tensor shapes in a typed pack into a runtime array.
Instances For
Tag each shape-erased tensor with its runtime index, beginning at start.
Instances For
Push the shape-erased tensors of a pack onto acc, from the head of the pack onward.
Instances For
Pushing onto acc appends the ordinary shape erasure to it.
toShapeErasedArray in one pass of pushes, which replaces it in compiled code.
Instances For
Compiled code runs toShapeErasedArrayFast in place of toShapeErasedArray.
Push the indexed shape-erased tensors of a pack onto acc, numbering from index.
Instances For
Pushing onto acc appends the ordinary indexed shape erasure to it.
toIndexedShapeErasedArray in one pass of pushes, which replaces it in compiled code.
Instances For
Compiled code runs toIndexedShapeErasedArrayFast in place of the indexed erasure.
Recover a statically shape-indexed pack from a prefix of a shape-erased runtime array.
start selects the first array entry to consume. The conversion checks every stored shape and
fails if the array is too short or an entry has the wrong shape. Entries after the requested pack
are intentionally ignored, which supports recovering a typed prefix of a larger runtime context.