That’s right! You can remove the transform=transforms.ToTensor() line when creating the dataset, if you would like to apply PIL transformation in __getitem__.
Or just add it in the constructor with transforms.Compose.