vt::transpose#

template<typename T, size_t N>
Tensor<T, N> vt::transpose(const Tensor<T, N> &tensor)#

Transpose the tensor. After transpose, it is not quaranteed that the tensor is contiguous.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:

tensor – The tensor object.

Returns:

Tensor<T, N>: The transposed tensor.

template<typename T, size_t N>
Tensor<T, N> vt::transpose(const Tensor<T, N> &tensor, const Shape<N> &axes)#

Transpose the tensor with given axes. After transpose, it is not quaranteed that the tensor is contiguous.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • tensor – The tensor object.

  • axes – The axes to transpose.

Returns:

Tensor<T, N>: The transposed tensor.