(feat1, feat2, feat1_, feat2_, pos, pos_p, psize)
return torch.sum(torch.pow(feat1[y:y+psize, x:x+psize,:]-feat2[yp:yp+psize, xp:xp+psize,:],2)) +\
        torch.sum(torch.pow(feat1_[y:y+psize, x:x+psize,:]-feat2_[yp:yp+psize, xp:xp+psize,:],2))
Return a distance
Return a distance
Return a distance
def feat_patch_distance(feat1, feat2, feat1_, feat2_, pos, pos_p, psize):
    """
    Return a distance
    """
    y, x = pos
    yp, xp = pos_p
    #print(pos, pos_p)
    return torch.sum(torch.pow(feat1[y:y+psize, x:x+psize,:]-feat2[yp:yp+psize, xp:xp+psize,:],2)) +\
        torch.sum(torch.pow(feat1_[y:y+psize, x:x+psize,:]-feat2_[yp:yp+psize, xp:xp+psize,:],2))
def feat_patch_distance ( feat1 , feat2 , feat1_ , feat2_ , pos , pos_p , psize ) : y , x = pos yp , xp = pos_p #print(pos, pos_p) return torch . sum ( torch . pow ( feat1 [ y : y + psize , x : x + psize , : ] - feat2 [ yp : yp + psize , xp : xp + psize , : ] , 2 ) ) + torch . sum ( torch . pow ( feat1_ [ y : y + psize , x : x + psize , : ] - feat2_ [ yp : yp + psize , xp : xp + psize , : ] , 2 ) )