-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 extra kwargs from Trainer init #1820
Conversation
as you can see in the first commit here, the tests fail because the flags |
we already had this discussion and it breaks inheritance... |
where was the discussion? I would like to know how it breaks inheritance. |
at least in IDE if the child has different arguments, @justusschock we talked about it, right? |
well, that's very unfortunate, because this PR shows then the tests are flawed if we allow unknown flags to be passed in without throwing an error |
So I looked at the discussion you link #1180 and I really don't get it.
So I would rather conclude that inheritance already IS broken @oplatek maybe you can explain it to me in super simple words? :) |
@awaelchli I agree with you that the benefit of more strict testing is larger than having Trainer simple to inherit... @PyTorchLightning/core-contributors do you see use-case when user need to inherit Trainer and add/remove some arguments? |
I thought the main arguments were:
Ad 3 I see it as is super convenient but for very rare use case and I see it as error prone when creating Trainer instance e.g. Trainer(max_epochs) vs Trainer(max_pochs) which fails silently and it is quite frequent case |
df68068
to
329c264
Compare
Hello @awaelchli! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-05-15 00:07:00 UTC |
@oplatek I agree with you, except that we don't have to make any compromises. |
Codecov Report
@@ Coverage Diff @@
## master #1820 +/- ##
======================================
Coverage 88% 88%
======================================
Files 71 71
Lines 4487 4487
======================================
+ Hits 3947 3954 +7
+ Misses 540 533 -7 |
@Borda I don't remember having such a discussion with you, but that may also be on me :D In general I would also opt for removing kwargs wherever possible |
nice @awaelchli |
Before submitting
What does this PR do?
You can actually observe this in tests!