The transformations will still be applied, if you pass a sampler to your DataLoader. In case you would like to apply different transformations for training, validation and test, you could create different Datasets with the corresponding transformation. After this step, you could pass the sampler to your DataLoaders or use Subset instead.