Hello I’m looking for a pytorch function that takes as input 3 index-coresponding tensors: X, Y, Z and returns a 2D matrix M with the values of Z accordingly. (M(y1, x1) = z1).
a function that operates similarly to what torch.scatter(…) does.
Thanks
M.view(-1).scatter_(0, Y * M.size(1) + X, Z)?
M.view(-1).scatter_(0, Y * M.size(1) + X, Z)
edit: index_scatter_ to scatter_
I can’t find documentation for the function index_scatter_ online.
Sorry, it should be just scatter_
scatter_
uh it should also be M.size(1). I updated above. Sorry!