Why DataLoader has both sampler as well as batch_sampler? while there is already a sampler that is torch.utils.data.BatchSampler? does that mean I can pass BatchSampler only as batch_sampler of DataLaoder?
If I want a DistributedSampler that is also in batches/BatchSampler and is random/RandomSampler I will have no option to mix them!
both DistributedSampler and RandomSampler wrap a dataset/data_source and only BatchSampler can wrap one of them.
Even if we could mix them, what would be difference of RandomSampler(BatchSampler(DistributedSampler(dataset)))  and BatchSampler(RandomSampler(DistributedSampler(dataset))).
So I think I should use sampler=DistributedSampler(dataset)  and pass a batch_size to DataLoader (or use sampler=BatchSampler(DistributedSampler(dataset))). But how can I make it random? shuffle is mutually exclusive from sampler and I cannot mix RandomSampler with DistributedSampler.