If your entire dataset contains 60000 samples and they also fit into your memory (MNIST would, but I won’t know if you’ve used it as a placeholder), then your approach looks correct and you could later torch.load the data.
However, in case your dataset is larger (and doesn’t fit into your RAM), you might want to store each sample or multiple samples in each file (the latter case might make the data loading a bit more complicated).