Hi all.
Example:
x = torch.zeros(10)
x
tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
indices = torch.tensor([1,1,3,3,3])
and I want to add value by index
x[indices] += 1
I get this
x
tensor([0., 1., 0., 1., 0., 0., 0., 0., 0., 0.])
But I want to get
x
tensor([0., 2., 0., 3., 0., 0., 0., 0., 0., 0.])
May be this impossible ?