Hello @Deeply ,
I think torch.manaul_seed() can guarantee the same shuffle sequence in each data_loader separately, but it cannot perform well between data_loaders. And I think worker_init_fn works in worker-wise in a dataloader, it can guarantee the random operations (like transformations) to the same in each process of a dataloader, so I think setting worker_init_fn to the same is not a proper solution.
If I am wrong, please correct me.
According to the source 11, when you set shuffle=True it will create a RandomSampler. In random_sampler it calls torch.randint to implement the random indices sequence, it is what the problem is. By setting torch.manaul_seed can guarantee the same sequence in each data_loader separately but why not all the data_loader?
Another method, you could pass the same RandomSampler to your dataloaders so that they will get the same random sequence I believe.