Concatenation and Slicing #
Concatenation, slicing, singleton dimensions, and layout transforms.
def
TorchLean.Tensor.concatAxisSpec
{α : Type}
[Storage α]
(leading : Spec.Shape)
{n m : ℕ}
{suffix : Spec.Shape}
:
Tensor α (leading.concat (Spec.Shape.dim n suffix)) →
Tensor α (leading.concat (Spec.Shape.dim m suffix)) → Tensor α (leading.concat (Spec.Shape.dim (n + m) suffix))
Concatenate at the axis following an arbitrary leading shape.
Instances For
@[irreducible]
def
TorchLean.Tensor.unsqueezeSpec
{α : Type}
[Storage α]
{shape : Spec.Shape}
(tensor : Tensor α shape)
(axis : ℕ)
(hAxis : axis ≤ shape.rank)
:
Tensor α (shape.insertAxis axis 1)
Insert a singleton dimension at any valid axis.