tensor.transpose
Returns a new tensor with the axes rearranged according to the given permutation.
Args
self
(@Tensor<T>
) - The input tensor.axes
(Span<usize>
) - The usize elements representing the axes to be transposed.
Panics
Panics if the length of the axes array is not equal to the rank of the input tensor.
Returns
A Tensor<T>
instance with the axes reordered according to the given permutation.
Examples
Last updated