I meant sampler=. The approach I described is effectively turning off auto-collation in PyTorch, i.e., to make the DataLoader think that it is loading a single data sample at the time, similar to
for index in sampler:
  yield convert_to_tensor(dataset[index])

It is just that to achieve bulk loading, we return a range / list of indices in sampler, which is used to index the dataset as a single key. If batch_sampler is used instead, DataLoader will unpack the list yielded by the batch_sampler and index the dataset with the resulting keys one-by-one.