The main.py 12 seems to show how to load the data. Probably you could adapt the code to load the data first and then wrap it in a Dataset. The Data Loading tutorial 16 might help you to implement an own Dataset.
Note that in a vanilla classification use case PyTorch expects a target filled with class indices while the code seems to load target in a one-hot encoded format.
To get the indices you can just call torch.argmax(targets, dim=1).