blackbirdbarber:

Try the example and you will see nothing will be transformed. Am I missing something obvious?


Your dataloader transforms the data. What’s incorrect is that you’re accessing the train set directly, and not the output of the dataloader.
More concretely, you must not access tr[0] directly. You should rather access the dataloader output. (accessing the zeroth index is as simple as calling next(iter(dl)))