pytorch报错: scatter_cpu_(): Expected self.dtype to be equal to src.dtype
最近在初学pytorch,然后在运行代码的时候出现了这个错误:import torch as ta = t.arange(0,16).view(4,4)index = t.LongTensor([[0,1,2,3],[3,2,1,0]]).t()b = a.gather(1,index)c = t.zeros(4,4)c.scatter_(1,index,b)print(c)----------------------------------------------------Runtim
原创
2020-09-14 10:19:31 ·
3728 阅读 ·
5 评论