DataLoader introspection. What is the next number in sequence of labels(target)?

I have a very obvious question: “How DataLoader creates labels?”.
For example:
First folder number 1 and label is 0.
Second folder number 10 and label is 1.
Third folder number 100 and label is 2. 100 is over.
So next should be 11 or am I wrong? Because I checked 11th folder very close but not exact picture.
Unfortunately, I have so many categories that it’s not easy to check.
What’s the next number in a sequence?
And how it’s called I mean such a calculation? If you provide a link to Python calculator I would be happy.

The DataLoader does not create the labels, but just wraps a Dataset to create batches, shuffle the samples, use multiple workers, etc.
If you are using something like torchvision.datasets.ImageFolder, the labels are created in the _find_classes method.
Basically it scans the directories and assigns an integer to each dir.

@ptrblck thank you for the answer. I didn’t know that labels are handled by ImageFolder. But this is an extremely nice feature that makes life easier. Just feed the folder and everything is ready.