The [PyTorch MNIST dataset](https://pytorch.org/docs/stable/torchvision/datasets.html#mnist) is **SLOW** by default, because it wants to conform to the usual interface of returning a PIL image. This is unnecessary if you just want a normalized MNIST and are not interested in image transforms (such as rotation, cropping). By folding the normalization into the dataset initialization you can **save your CPU and speed up training by 2-3x**.
0 commit comments