Elegant way to transpose a variable

For example,

A Tensor with shape [2, 3, 4] -> [4, 2, 3]

In numpy, we could directly use np.transpose(Tensor, [2, 0, 1]). However, in pytorch, I could not find a elegant way to do it.

Thanks for your help.

torch.Tensor.permute…

2 Likes

Thanks.
I miss it in the document.