@ptrblck That’s not quite what I want. I want to correlate N feature tensors of C channels each with N other feature tensors of C channels each. You can think of this as “template matching”  two different set of features. I have added more detail to the code I posted above to help clarify this below:
images1_features = some_cnn(images1) #image1_features.shape = 32,100,8,8
images2_features = some_cnn(images2) #image2_features.shape = 32,100,8,8
#I now have 32 sets of two tensors representing the deep features of pictures in images1 and pictures in images2. 
#The pictures in images2 are shifted versions of pictures in images1 and therefore I would like to cross correlate corresponding feature batches to compute spatial alignment.
#Following is a sequential way of doing this but I would like the processing to be parallel across batches.
n, c, h, w = image1_features.shape
peak_locations = []
for i in range(n):
    corr = F.conv2d(image1_features[i,:,:,:].unsqueeze(0), image2_features[i,:,:,:].unsqueeze(0), padding=(h, w))
    peak_location = peak_interpolate(corr)
    peak_locations.append(peak_location)
peak_locations = torch.cat(peak_locations,dim=0) #peak_locations.shape = 32,2 (32 images with x,y vector representing displacement)