-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Transpose SVHN to HWC on class init #3611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @augustoolucas! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Codecov Report
@@ Coverage Diff @@
## master #3611 +/- ##
==========================================
- Coverage 79.73% 79.69% -0.04%
==========================================
Files 105 105
Lines 9818 9824 +6
Branches 1579 1583 +4
==========================================
+ Hits 7828 7829 +1
- Misses 1513 1517 +4
- Partials 477 478 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
Thanks for the PR!
The change looks good to me, although it could be considered BC-breaking if a user were to access self.data
directly (which I would hope it's not the case, but given that you are sending this PR then there might be users doing it :-) )
From this perspective, and given that we don't currently have a good way of checking if this is being used by others, I'd maybe prefer to restrain from merging this PR.
Thoughts?
I was thinking the same, and I was wondering: from now on, should we make it a habit of always introducing attributes as privates (e.g. with a leading |
@NicolasHug yes, I think from now on we might want to start prefixing the attributes of new datasets / etc with an underscore, so that we can have more flexibility there. |
What if we pay the debt now, make the |
Well, don't know if I have much more to add to this discussion but... |
Thanks again for the PR @augustoolucas . Unfortunately our hands are tied with the backward compatibility changes here, so I'll close the PR if you don't mind. However, we're currently working on re-implementing the datasets in a more unified and flexible fashion, so we can be confident that this issue will be fixed in the future! CC @pmeier : this will probably be something to keep in mind when implementing the equivalent DataPipe class :) |
SVHN is transposed into HWC when converting it into PIL Image, on the getitem method. This is inconsistent with other datasets, like CIFAR10 and MNIST, where the image is already on the right shape at the moment of the PIL conversion. This inconsistency makes it needed to do two transpositions instead of only one, and can make it troublesome to use this dataset together with others, like the aforementioned ones.
This PR fix this behaviour, transposing the data into HWC on class init.