Solved by ptrblck in post #4 
              
              
                You could achieve this with tensor.scatter_add_: 
A = torch.tensor([[0.7,  1.3], 
                  [56.1, 7. ]])
I = torch.tensor([[1, 2], 
                  [0, 0]])

torch.zeros(2, 3).scatter_add_(1, I, A)