How can I change the default image shape in PyTorch?
I've noticed that PyTorch uses images with shape (channels, width, height). How can I change it to (width, height, channels)?
I am looking for a switch kind of think which switches between the two modes.

You can use torch.permute:
tt = torch.tensor([[[0, 0], [1,1]], [[0,1], [1,0]], [[2, 2], [2, 2]]])
# &gt; tensor([[[0, 0], [1, 1]],
#           [[0, 1], [1, 0]],
#           [[2, 2], [2, 2]]])
print(tt.shape)
# &gt; torch.Size([3, 2, 2])

tt2 = tt.permute(1, 2, 0)
# &gt; tensor([[[0, 0, 2], [0, 1, 2]],
#           [[1, 1, 2], [1, 0, 2]]])
print(tt2.shape)
# &gt; torch.Size([2, 2, 3])

