-
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
extend arg parser #1842
extend arg parser #1842
Conversation
Hello @Borda! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-05-14 20:06:36 UTC |
Codecov Report
@@ Coverage Diff @@
## master #1842 +/- ##
======================================
Coverage 88% 88%
======================================
Files 71 71
Lines 4474 4485 +11
======================================
+ Hits 3929 3946 +17
+ Misses 545 539 -6 |
pytorch_lightning/trainer/trainer.py
Outdated
def parse_argparse(cli_parser: ArgumentParser) -> Namespace: | ||
"""Parse CLI arguments, required for custom bool types.""" | ||
args = vars(cli_parser.parse_args()) | ||
args = {k: True if v is None else v for k, v in args.items()} |
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.
what about including this in the from_argparse_args
method, since most user setup already is:
parser = argparse.ArgumentParser(...)
parser = pl.Trainer.add_argparse_args(parser)
args = parser.parser_args()
trainer = pl.Trainer.from_argparse_args(args)
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.
sounds interesting :]
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, pls check it now, plus added your code as example
LGTM |
What does this PR do?
Fixes #1829
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃