Hello,
I had a similar issue today and here’s my solution (FYI).
(credit : numpy - Add a index selected tensor to another tensor with overlapping indices in pytorch - Stack Overflow)
to_be_filled = torch.zeros((2, 7))
index = torch.tensor([
    [0, 1], # adding 0.4
    [0, 2], # adding -1.4
    [0, 3], # adding -1.13
    [0, 6], # adding -1
    [1, 2], # adding 3
    [0, 1]  # adding 2
])
values = torch.tensor([
    0.4,    # at coordinates (0, 1)
    -1.4,   # at coordinates (0, 2)
    -1.13,  # at coordinates (0, 3)
    -1,     # at coordinates (0, 6)
    3,      # at coordinates (1, 2)
    2       # at coordinates (0, 1)
])

filled = torch.index_put(to_be_filled, (index[:, 0], index[:, 1]), values, accumulate=True)

The result of ‘filled’ is
tensor([[ 0.0000,  2.4000, -1.4000, -1.1300,  0.0000,  0.0000, -1.0000],
        [ 0.0000,  0.0000,  3.0000,  0.0000,  0.0000,  0.0000,  0.0000]])

Best,