Hello, I just wonder that the bilinear interpolation operation based ‘grid_sample’ is often used to compute affine transformation or in the spatial transformaiton network

I already know that this function does propagate the grad to the input data
but does this function propagate the grad to the input grid?

why 0 grad with nearest mode but not ‘bilinear’ mode, big thx~ @SimonW I am little bit confused after hours of thinking, how actually did the back end kernel calculate the grad for each grid point? I just cant figure out, much thx

What a amazing reply, hope it didnt waste your time @SimonW,
I understand it a little bit more now, and I will step further into the source code you post
If I got further questions I’d like to have your advice, much thx