I tried this but the speed is the same as previous. Previously I did something like this:
for index,data in enumerate(zip(dataloader1,cycle(dataloader2)):
The dataloader2 is the dataloader of the small size dataset, hence to prevent dataloader2 from exhausting, I use the cycle function from itertools which repeats the dataloader2 until dataloader1 is exhausted.