Question of concatdataset

when I don’t use concatdataset, it’s ok.
But when I use concatdataset, I get the error RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument tensors in method wrapper___cat).
I don’t know why, as the bug happens when the code executes at the following
for i, (images, labels) in enumerate(data_loader):

I guess one of your internal datasets might use samples stored on the CPU while another one tries to use samples stored on the GPU. Check how each dataset loads the sample in its __getitem__ and make sure to use the same device.

I just load CIFAR10 dataset partly using different transforms. How to solve it?

Try to narrow down the issue using my previous suggestion. If you get stuck you can also post a minimal, executable code snippet reproducing the issue.