Function nvcv::Permute

Function Documentation

inline TensorShape nvcv::Permute(const TensorShape &src, TensorLayout dstLayout)

Function to permute the dimensions of a tensor to a new layout.

This function rearranges the dimensions of the tensor according to a new layout. It can be used to change the order of dimensions, for example, from NHWC (channel-last) to NCHW (channel-first) and vice versa.

Parameters:
  • src – The original tensor shape.

  • dstLayout – The desired layout after permutation.

Returns:

The new TensorShape with permuted dimensions according to the desired layout.