TorchLean API

NN.Spec.Core.Tensor.Packed

Shape-Tagged Tensors #

A small existential package for storing tensors whose shapes are known only at runtime. The package and its shape-changing adjacent-swap operation are shared by executable tensor interpreters.

@[reducible, inline]
abbrev Spec.PackedTensor (alpha : Type) [Context alpha] :

A tensor paired with the shape that indexes its type.

Instances For
    def Spec.PackedTensor.shape {alpha : Type} [Context alpha] (value : PackedTensor alpha) :

    The runtime shape carried by a packed tensor.

    Instances For
      def Spec.PackedTensor.tensor {alpha : Type} [Context alpha] (value : PackedTensor alpha) :
      Tensor alpha value.shape

      The tensor stored in a packed tensor, indexed by its recovered shape.

      Instances For
        def Spec.PackedTensor.mk {alpha : Type} [Context alpha] (shape : Shape) (tensor : Tensor alpha shape) :

        Package a statically shaped tensor for shape-erased storage.

        Instances For
          def Spec.PackedTensor.swapAdjacentAtDepth {alpha : Type} [Context alpha] (value : PackedTensor alpha) (depth : ) :

          Swap two adjacent axes at depth, retaining the resulting shape in the package.

          Instances For