Access image pixels from [Nx2] float tensor

I have an image of size [500, 500]

I also have a tensor that was generated by a method of size [N X 2]. I need to access in a differentiable way, the outputs of the indexing of the image. So an element in the [NX2] contains a pixel position as a float, and I want to access that index in the image and get the value. Assuming that pixel is within the image.

Is this actually possible?