-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Remove duplicate code #1125
Remove duplicate code #1125
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1125 +/- ##
==========================================
+ Coverage 64.79% 64.84% +0.04%
==========================================
Files 68 68
Lines 5417 5413 -4
Branches 835 835
==========================================
Hits 3510 3510
+ Misses 1648 1645 -3
+ Partials 259 258 -1
Continue to review full report at Codecov.
|
@@ -22,8 +22,6 @@ class FakeData(VisionDataset): | |||
def __init__(self, size=1000, image_size=(3, 224, 224), num_classes=10, | |||
transform=None, target_transform=None, random_offset=0): | |||
super(FakeData, self).__init__(None) | |||
self.transform = transform |
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.
It would be even better if you deleted both occurrences and passed transform
and target_transform
to the constructor of the parent class.
vision/torchvision/datasets/vision.py
Line 9 in 8d580a1
def __init__(self, root, transforms=None, transform=None, target_transform=None): |
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.
Done. Thanks for this suggestion. In cifar.py
, caltech.py
etc, I didn't look for all datasets, is it necessary to pass transform
and target_transform
to the constructor? If yes, I'm appreciate to do this in this PR.
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.
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.
Thanks!
No description provided.