tensor.permute()和tensor.transpose()
示例文件 test.pyimport torchcor1 = torch.arange(5).float()cor2 = torch.arange(4).float()print(cor1)print(cor2)X, Y = torch.meshgrid(cor1, cor2)print(X)print(X.permute(0, 1))print(X.permute(1, 0))print(X.transpose(0, 1))print(X.transpose(1, 0))终端