Thank you for your reply! But it doesn’t seem to be compatible with my task
There is an example of using tf.gather_nd in the context
inputs shape: (1, 120, 160, 128)  ## [N, H, W, C], which stands for dense feature map
indices shape: (1, 512, 2)  ##[N, num_points, channel], which stands for a set of points [ [[iiiii], [jjjjj]] ]
output = tf.gather_nd(inputs, indices, batch_dims = 1)
print(output.get_shape())
>>> (1, 512, 128)

And just now I find out that in the above interpolate function, we could just simply delete the useless dimension expanding squeezing part at the beginning and the end to get it in a lower dimension case, which can also keep the result meaningful :
inputs shape: (120, 160, 128)
indices shape: (512, 2)
tf.gather_nd:  (512, 128)

Is there equivalence in Pytorch to get the equivalent result like this ? :
inputs :(1, 128, 120, 160)
indices:(1, 2, 512)
gather_nd_torch(inputs, indices)
>>>output:(1, 128, 512)

or this:
inputs :(128, 120, 160)
indices:(2, 512)
gather_nd_torch(inputs, indices)
>>>output:(128, 512)