Solved by albanD in post #16 
              
              
                Right. 
That should be significantly faster already. 
Using fancier function and playing with views, you might be able to narrow it down to a single call. But that shouldn’t be necessary  
import torch
from torch.nn import functional as F
import numpy as np

image = torch.randn(1, 1, 60, 60)
coor = …