It is not loaded in this line. RandomSampler class is just a tool for the Dataloader class. As I said before, if you have a look to the Dataloader class, you will find this :
  if batch_sampler is None:
        if sampler is None:
            if shuffle:
                sampler = RandomSampler(dataset)
            else:
                sampler = SequentialSampler(dataset)
        batch_sampler = BatchSampler(sampler, batch_size, drop_last)

So your dataloader will store the data following this order (assuming you are in the sampler = RandomSampler(dataset) if condition):

torch.randperm(len(self.data_source)).long()

This is how RandomSampler works. So you want to custom the RandomSampler class in order to control how your data are loaded in your dataloader. Once it is done you will know which one you are currently working on when you enumerate through your dataloader.