Pytorch常用函数

1.view() 直接上例子: import torch x=torch.randn(6,6) y=x.view(x.size(0),2,-1)  #保持第一维,对后面两维做resize y.size()=(6,2,3) 2.cat (多个tensors的拼接) import torch x=torch.randn(2,3) torch.cat((x,x),0)  #行拼接4*3 torch.ca
相关文章
相关标签/搜索