permute#

Permute the dimensions of an operator

template<typename T>
__MATX_INLINE__ auto matx::permute(const T &op, const int32_t (&dims)[T::Rank()])#

Operator to permute the dimensions of a tensor or operator.

The each dimension must appear in the dims array once.

This operator can appear as an rvalue or lvalue.

Template Parameters:

T – Input operator/tensor type

Parameters:
  • op – Input operator

  • dims – the reordered dimensions of the operator.

Returns:

permuted operator

template<typename T>
__MATX_INLINE__ auto matx::permute(const T &op, const std::array<int32_t, T::Rank()> &dims)#

Operator to permute the dimensions of a tensor or operator.

The each dimension must appear in the dims array once. This operator can appear as an rvalue or lvalue.

Template Parameters:

T – Input operator/tensor type

Parameters:
  • op – Input operator

  • dims – the reordered dimensions of the operator.

Returns:

permuted operator

Examples#

// Permute from dims {0, 1, 2} to {2, 0, 1}
auto op = permute(A, {2, 0, 1});