Pytorch常用函数
1.view()直接上例子:import torchx=torch.randn(6,6)y=x.view(x.size(0),2,-1) #保持第一维,对后面两维做resizey.size()=(6,2,3)2.cat (多个tensors的拼接)import torchx=torch.randn(2,3)torch.cat((x,x),0) #行拼接4*3torch.cat((x,x),1 ...
原创
2018-05-03 09:04:49 ·
1252 阅读 ·
0 评论