t = torch.arange(24).reshape(2, 3, 4) print(t.permute(2, 0, 1).shape) # torch.Size([4, 2, 3])