@ptrblck I actually need to do the same but the channel dimensions are larger than one. Is there any efficient way to solve this (i.e deep feature correlation parallelized across batches)?
Currently I am using the following slow sequential solution:
n, c, h, w = image1_features.shape
for i in range(n):
    corr = F.conv2d(image1_features[i,:,:,:].unsqueeze(0), image2_features[i,:,:,:].unsqueeze(0), padding=(h, w))