Thank you for your guidance, @DAlolicorn .
I changed the __len__ that the problem is solved.
I also changed x = torch.stack((x1,x2)) to x = torch.cat((x1,x2),2) since torch.stack was generating the images with dimension torch.Size([64, 2, 3, 32, 32]).
Regarding ConcatDataset , I am not sure by having the current __getitem__ how I should feed datasets to ConcatDataset?
I also was trying:
 for batch_idx, (inputs, targets, idx) in loader:
but it shows an error, this for loop is wrong?