Trait tc_collection::tensor::TensorTransform
source · pub trait TensorTransform {
type Broadcast: TensorInstance;
type Expand: TensorInstance;
type Reshape: TensorInstance;
type Slice: TensorInstance;
type Transpose: TensorInstance;
// Required methods
fn broadcast(self, shape: Shape) -> TCResult<Self::Broadcast>;
fn expand(self, axes: Axes) -> TCResult<Self::Expand>;
fn reshape(self, shape: Shape) -> TCResult<Self::Reshape>;
fn slice(self, range: Range) -> TCResult<Self::Slice>;
fn transpose(self, permutation: Option<Axes>) -> TCResult<Self::Transpose>;
}
Expand description
Tensor
transforms
Required Associated Types§
sourcetype Broadcast: TensorInstance
type Broadcast: TensorInstance
A broadcast Tensor
sourcetype Expand: TensorInstance
type Expand: TensorInstance
A Tensor
with an expanded dimension
sourcetype Reshape: TensorInstance
type Reshape: TensorInstance
A reshaped Tensor
sourcetype Slice: TensorInstance
type Slice: TensorInstance
A Tensor
slice
sourcetype Transpose: TensorInstance
type Transpose: TensorInstance
A transposed Tensor
Required Methods§
sourcefn broadcast(self, shape: Shape) -> TCResult<Self::Broadcast>
fn broadcast(self, shape: Shape) -> TCResult<Self::Broadcast>
Broadcast this Tensor
to the given shape
.
sourcefn expand(self, axes: Axes) -> TCResult<Self::Expand>
fn expand(self, axes: Axes) -> TCResult<Self::Expand>
Insert a new dimension of size 1 at each of the given axes
.