Pytorch的tensor操作
permute()函数
是对tensor的维度位置进行变换
具体理解看代码
a = torch.rand(1, 2, 3)
print(a.shape)
a = a.permute(2, 1, 0)
print(a.shape)
torch.Size([1, 2, 3])
torch.Size([3, 2, 1])
标签:26,01,tensor,torch,shape,2021,print,permute,Size
来源: https://blog.csdn.net/m0_49289284/article/details/113176684