richukuttan:

Also, can you explain how to access all elements of a given class after it has been dumped to the dataset


This depends on the dataset, look at the source code to figure this out: https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py 250