Hi,
What is the possible way to perform the gradient on the index?
I am trying to do something like “spatial transform network”.
However, I need to do the sample on a branch of input so I want to try this by my own.
something like:
# build the index from range
x,y,u,v = meshgrid(...)

# select the pixel from indexs

torch.gather(img,4,torch.stack([x,y,u,v],-1))


This will done by tensorflow as:
tf.gather_n(img,torch.stack([x,y,u,v],-1))

however, I get the error on pytorch that  Gather can't differentiate the index
any ideas about this problem?
thanks in advanced.