Answers for "changing the axis in python pytorch"

2

pytorch tensor change dimension order

a = torch.rand(1,2,3,4)
print(a.transpose(0,3).transpose(1,2).size())
print(a.permute(3,2,1,0).size())
Posted by: Guest on April-20-2020

Code answers related to "changing the axis in python pytorch"

Python Answers by Framework

Browse Popular Code Answers by Language