pub trait PermuteTo: HasErr + HasShape {
    // Required method
    fn try_permute<Dst: Shape, Ax: Axes>(
        self
    ) -> Result<Self::WithShape<Dst>, Self::Err>
       where Self::Shape: PermuteShapeTo<Dst, Ax>;

    // Provided method
    fn permute<Dst: Shape, Ax: Axes>(self) -> Self::WithShape<Dst>
       where Self::Shape: PermuteShapeTo<Dst, Ax> { ... }
}
Expand description

Changes order of dimensions/axes

Required Methods§

source

fn try_permute<Dst: Shape, Ax: Axes>( self ) -> Result<Self::WithShape<Dst>, Self::Err>where Self::Shape: PermuteShapeTo<Dst, Ax>,

Fallible version of PermuteTo::permute

Provided Methods§

source

fn permute<Dst: Shape, Ax: Axes>(self) -> Self::WithShape<Dst>where Self::Shape: PermuteShapeTo<Dst, Ax>,

Permutes the tensor:

let a: Tensor<Rank3<1, 2, 3>, f32, _> = dev.zeros();
let _ = a.clone().permute::<Rank3<3, 2, 1>, _>();
let _ = a.clone().permute::<_, Axes3<2, 1, 0>>();

Implementors§

source§

impl<S: Shape, E: Unit, D: DeviceStorage, T: Tape<E, D>> PermuteTo for Tensor<S, E, D, T>