'torch' has no attribute 'scatter'

In torch version: 1.0.0, there is no ‘scatter’ function.
How can I use this ‘scatter’ ?

Hi oasjd7!

I’ve never used version 1.0.0, so I’m just guessing …

According to the 1.0.0 documentation for torch.Tensor the Tensor
class has an in-place .scatter_() method.

That is, you would call the .scatter_() method on an instance of the
Tensor class, making a copy of your Tensor, as necessary (because
.scatter_() in an in-place operation).

(Or you could use a newer version of pytorch.)

Best.

K. Frank

1 Like