pub trait TensorTransform {
    type Broadcast: TensorInstance;
    type Cast: TensorInstance;
    type Expand: TensorInstance;
    type Flip: TensorInstance;
    type Reshape: TensorInstance;
    type Slice: TensorInstance;
    type Transpose: TensorInstance;

    fn broadcast(self, shape: Shape) -> TCResult<Self::Broadcast>;
    fn cast_into(self, dtype: NumberType) -> TCResult<Self::Cast>;
    fn expand_dims(self, axis: usize) -> TCResult<Self::Expand>;
    fn flip(self, axis: usize) -> TCResult<Self::Flip>;
    fn reshape(self, shape: Shape) -> TCResult<Self::Reshape>;
    fn slice(self, bounds: Bounds) -> TCResult<Self::Slice>;
    fn transpose(
        self,
        permutation: Option<Vec<usize>>
    ) -> TCResult<Self::Transpose>; }
Expand description

Tensor transforms

Required Associated Types

A broadcast Tensor

A type-cast Tensor

A Tensor with an expanded dimension

A Tensor flipped around one axis

A reshaped Tensor

A Tensor slice

A transposed Tensor

Required Methods

Broadcast this Tensor to the given shape.

Cast this Tensor to the given dtype.

Insert a new dimension of size 1 at the given axis.

Flip this Tensor around the given axis.

Change the shape of this Tensor.

Return a slice of this Tensor with the given bounds.

Transpose this Tensor by reordering its axes according to the given permutation. If no permutation is given, the axes will be reversed.

Implementors