converting tensorflow transpose to pytorch
What is the equivalent function of
x = tf.transpose(y, perm=[2, 0, 1])

in pytorch?
For instance, If I have
import torch
y=torch.randn(10, 480, 640)

How can I convert y to x in pytorch?

You can use torch.Tensor.permute:
&gt;&gt;&gt; x = y.permute(2, 0, 1)

