Trait tc_tensor::TensorTransform
source · [−]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
type Cast: TensorInstance
type Cast: TensorInstance
A type-cast Tensor
type Expand: TensorInstance
type Expand: TensorInstance
A Tensor
with an expanded dimension
type Flip: TensorInstance
type Flip: TensorInstance
A Tensor
flipped around one axis
type Reshape: TensorInstance
type Reshape: TensorInstance
A reshaped Tensor
type Slice: TensorInstance
type Slice: TensorInstance
A Tensor
slice
A transposed Tensor
Required Methods
Broadcast this Tensor
to the given shape
.
Cast this Tensor
to the given dtype
.
fn expand_dims(self, axis: usize) -> TCResult<Self::Expand>
fn expand_dims(self, axis: usize) -> TCResult<Self::Expand>
Insert a new dimension of size 1 at the given axis
.
Return a slice of this Tensor
with the given bounds
.