a = torch.randn(1,1,3,1)
a.expand(2,1,3,1)
a.expand(1,2,3,1)
a.expand(1,1,6,1)#runtimerror
a.expand(1,1,3,2)
a.expand(1,1,3,1)#a.expand(1,1,3,1) == a
b = torch.randn(1,1,2,2)
b.repeat(1,1,1,1)#b.repeat(1,1,1,1) == b
b.repeat(1,1,1,2)#b.repeat(1,1,1,2).shape -> torch.Size([1,1,2,4])
b.repeat(1,3,1,2)#b.repeat(1,3,1,2).shape -> torch.Size([1,3,2,4])
b.repeat(1,3,1,1) == b.expand(1,3,2,2) #return torch.ones(1,3,2,2,dtype=torch.uint8) or torch.ones([1,3,2,2],dtype=uint8)
'''view()'''
b.view(4)#torch.Size([4])
b.view(1,1,2,2)#b.view(1,1,2,2) == b
b.view(1,2,1,-1)#torch.Size([1,2,1,2])
'''torch.cat([],1)'''
c = torch.randn(1,2,2,2)
torch.cat([b,c],0)#RuntimeError
torch.cat([b,c],1)#torch.Size([1,3,2,2])除要合并的通道外,其余通道必须保持一致
torch.cat([b,c],2)#RuntimeError
torch.cat([b,c],3)#RuntimeError
'''torch.sqeeuze()''&#