I’m not sure you can apply a transform on DataLoader. Maybe you could subclass TensorDataset and add a transform argument to the constructor, then override __getitem__ to call the parent’s __getitem__ and apply the transform to the returned data.