Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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())
Source by discuss.pytorch.org #
 
PREVIOUS NEXT
Tagged: #pytorch #tensor #change #dimension #order
ADD COMMENT
Topic
Name
5+9 =