If you would like to create another Dataset with the same structure as MNIST, e.g. as a replacement, have a look at torchvision.datasets.MNIST 145. There you will see which data is downloaded, unzipped, and how the binary data is processed.
Maybe that helps.