Hello,
the output of my net is a regression expressing pixels spatial offsets Delta X from the closest marker. I need to use such Delta X as index of a matrix used in the customised loss function. The problem is that if I convert such Delta X into long, the requires_grad of Delta_X  is switch automatically to False, I guess because this is not a linear operation. And as such, the net does not learn. On the other hand, if I don’t converting Delta X into a long, I obviously get an error because the index of a matrix cannot be a float.
Any suggestion on how I can bypass this problem?
Thanks for helping