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
type Broadcast: TensorInstance
type Broadcast: TensorInstance
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 Slice: TensorInstance
type Slice: TensorInstance
A Tensor
slice
type Transpose: TensorInstance
type Transpose: TensorInstance
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
.