Is there a pytorch equivalent of numpy’s put_along_axis functionality?
I am trying to make values of a tensor to 1 based on given indices in another tensor. Rightnow, I am doing this using numpy and wondering if there is any better way to do this Pytorch?
replace values of zero_tensor from 0 to 1, where the indices are given by the index_tensor. And this operation has to be performed row-wise.
“scatter_” solves this problem. Now I don’t need to use put_along_axis from numpy. Thanks once again.