vt::swapaxes#

template<typename T, size_t N>
Tensor<T, N> vt::swapaxes(const Tensor<T, N> &tensor, int axis1, int axis2)#

Swap the axis of the tensor.

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

  • N – Number of dimensions of the tensor.

Parameters:
  • tensor – The tensor object.

  • axis1 – The first axis.

  • axis2 – The second axis.

Returns:

Tensor<T, N>: The tensor with swapped axes.