Does the cifar100 dataset of pytorch provide coarse labels?

A quick question here about cifar100

I am wondering if the cifar100 dataset of pytorch provide a way to get the coarse labels or if there is 3rd implemented codes to realize this.

I have refered to the manual of torchvision.datasets.CIFAR100, there seems to be no description about coarse labels.

Thanks in advance

No such option in torchvision.datasets.CIFAR100
Solved by adding an option parameter to the code of
See the modified code at


Iā€™m not sure, but it should be easy to implement a map from

Thanks for your quick reply.
I have just check the source code and there is no such option.

Just handled this by simply modifying the source code a little by adding a coarse_labels key.