pytorch_scatter icon indicating copy to clipboard operation
pytorch_scatter copied to clipboard

RuntimeError

Open kiki-win opened this issue 2 years ago • 1 comments

RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #3 'index' in call to th_scatter_add The above operation failed in interpreter. Traceback (most recent call last): File "//anaconda3/envs/geometric/lib/python3.8/site-packages/torch_scatter/scatter.py", line 22 size[dim] = int(index.max()) + 1 out = torch.zeros(size, dtype=src.dtype, device=src.device) return out.scatter_add_(dim, index, src) ~~~~~~~~~~~~~~~~ <--- HERE else: return out.scatter_add_(dim, index, src)

Can you help me to solve this problem?

kiki-win avatar Mar 25 '22 01:03 kiki-win

Can you confirm that your index tensor is of type torch.long via index = index.long()?

rusty1s avatar Mar 25 '22 07:03 rusty1s

This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?

github-actions[bot] avatar Sep 22 '22 02:09 github-actions[bot]