Feature/Bug Requested:

The classes attribute of EMNIST dataset does not take into account the split argument. From the original EMNIST dataset https://www.nist.gov/itl/products-and-services/emnist-dataset

Understanding the Problem:

The Existing code doesn’t consider the splits parameter that is passed to the dataset. This is because the EMNIST Class inherits the Default MNIST Class and doesn’t set the classes attribute appropriately.

Solution?

I knew that overriding the classes attribute should do the job. From the details provided in the issue and from the link, I was able to create a dictionary that maps the splits into classes. I was a not confident with my solution initially, but then I tried to use it locally with my changes in place and gained confidence over my changes. Finally, I override the classes attribute to get the expected behaviour.

Key Learnings:

  1. Always create a branch for developing a feature or fixing a bug. Working on Master branch of fork will be a mess as other features can get merger to master branch of Original repo and syncing will be difficult.
  2. Dont be afraid to commit mistakes or submit dumb solutions. Not all solutions are great. Maintainers are there to help and will review the changes and suggest better approaches if any .
  3. Don’t forget to lint the code before pushing a change. I had to submit a few times to get the linting part correct.

I Know the changes are not much, but I feel thrilled that I have a PR merged in torchvision repo. Thanks for reading. I encourage you to try to contribute to any Open Source project. I can assure it will be a great learning experience