TorchLean API

NN.Spec.Core.TensorReductionShape.ConcatSlice

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.

    Instances For