2021
03-05
03-05
Pytorch之扩充tensor的操作
我就废话不多说了,大家还是直接看代码吧~b=torch.zeros((3,2,6,6))a=torch.zeros((3,2,1,1))a.expand_as(b).size()Out[32]:torch.Size([3,2,6,6])a=torch.zeros((3,2,2,1))a.expand_as(b).size()Traceback(mostrecentcalllast):File"/home/lart/.conda/envs/pt/lib/python3.6/site-packages/IPython/core/interactiveshell.py",line3267,inrun_codeexec(code_obj,self.user_global_ns,self.user...
继续阅读 >