You won’t be able to manipulate the underlying .dataset through the DataLoader, if you are using multiple workers during the epoch, since each worker will use a separate copy of the Dataset.
You could manipulate the .dataset after each epoch and before the start of a new one (if persistent_workers=False) or you could iterate the Dataset and create the batches manually.
Alternatively, you could also try to forward specific arguments to the __getitem__ through a custom sampler to switch between different behaviors.