'torch._C' has no attribute '_scatter'

Hi! I have been searching this error endlessly but no one seems to have gotten it.

File “/usr/local/lib/python3.6/site-packages/torch/cuda/comm.py”, line 148, in scatter
return tuple(torch._C._scatter(tensor, devices, chunk_sizes, dim, streams))
AttributeError: module ‘torch._C’ has no attribute ‘_scatter’

It comes from some code that tries to distribute tensors across multiple processors. I am running on my personal machine (mac) and specifying device_id=[-1] (which means just run on one cpu), but am still having issues. I dug through the torch code and could not find where _scatter is in torch._C. Could anyone shed some light on this? Thanks, much appreciated!!

It’s here: https://github.com/pytorch/pytorch/blob/acc83ad54ef85eacd3c7ebfe20ee8225164e5bd1/torch/csrc/cuda/python_comm.cpp#L35-L50

Oh okay thank you! Hm I have the latest version of torch, do you know why it thinks _scatter is not there?

@jli did you find a fix by now? I encounter the same problem on with the Nightly version of pytorch (pip installed on a mac with MPS acceleration)