Hi Juan, Thank you for your reply. I didn’t get how to proceed in practice to solve my specific problem:
given in input the tensors corresponding to the 2 dataset during the initialization I can create one single dataset where the 2 “subdataset keeps divided”: this step is fine, I get it.
Now let say that I have 800 samples in the first “subdataset” and 400 in the second one.
How should I set the __getitem__  method to get back in each call from the dataloader B images (and corresponding targets) from the first “dataset” and B/2 from the second one (so that I recall all the element of the 2 “subdataset” using a common number of batches)?