My bad I apologize. 
I should have checked the dates.
Yup, sure the code helps.
Is there any implementation more in a “pytorch” way not using C src. ? Say using the functional.interpolate() layer ?
Or could you give an understanding of the geometric transform of how you calculate “y_in”  and “x_in” in the loop per box 4 ?
I want to use this for a randomly oriented quadrilateral roi’s, defined as a rotated bounding box, with 8 coordinates as input as opposed to a horizontal box defined by 4 coordinates.