import torch
a = torch.arange(12).reshape(3,2,2)print(a)print(a.reshape(3,4))# 按照现在要求的格式进行重新排序print("-----------")
c = a.permute(2,1,0)# 将原先维度的数据挑选出来按照现在要求的维度进行重新组合print(c)print(c.shape)print("-----------")
d = a.transpose(2,1)# 将第三维和第二维进行转置 print(d)print(d.shape)