Yes. I tried the second one and got a overfitting. I didn’t try the first one, but just found the following implementation is also ok.
input_cat =  torch.cat([x0,x1],0)
output_cat = model(input_cat ) 
loss = criterion (first half of output_cat , second half of output_cat)