How to achieve tf.scatter_nd in pytorch? project for copynet

I already asked it there: Edit a subtensor of a 3D tensor

But I think I will do this function by hand and create a pull request. It should not be difficult after all.