Opposite of grid_sample

grid_sample samples values from the coordinates of the input. I was wondering if there was a way to do the reverse: assigning values to particular coordinates of the output, with the coordinates being within [-1,1].
Is there a way to do this?

Any help is appreciated.

Solved. I inverted the affine transformation I used to generate the grid, and used grid_sample as normal.


Iā€™m actually looking for the same thing! ideally with support for reversing the bilinear interpolation that was used when extracting with grid_sample. @ptrblck @albanD @SimonW any insights on this? Thanks!