What is the difference between concatenating two image and passing it through resnet network ,while passing both images individually to the network. Code 1 for 1st scenario and code 2 for second.
Code 1
images=[x1,x2]
images = torch.cat([images[0], images[1]], dim=0)
bsz = labels.shape[0]
features = model(images)
f1, f2 = torch.split(features, [bsz, bsz], dim=0)
features = torch.cat([f1.unsqueeze(1), f2.unsqueeze(1)], dim=1)

Code 2
x1 and x2 images
out_1 = model(x1)
out_2 = model(x2)
out = torch.cat([out_1, out_2], dim=0)

Note : The output dimension from the model will be 128