Trait tc_tensor::TensorTransform[][src]

pub trait TensorTransform {
    type Broadcast: TensorInstance;
    type Cast: TensorInstance;
    type Expand: 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 slice(self, bounds: Bounds) -> TCResult<Self::Slice>;
fn transpose(
        self,
        permutation: Option<Vec<usize>>
    ) -> TCResult<Self::Transpose>; }
Expand description

Tensor transforms

Associated Types

A broadcast Tensor

A type-cast Tensor

A Tensor with an expanded dimension

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.

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