-
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
Type Hints for Trainer #912
Conversation
Hello @awaelchli! Thanks for updating this PR.
Comment last updated at 2020-02-23 02:14:22 UTC |
@@ -124,7 +129,7 @@ def __init__( | |||
|
|||
Trainer(logger=logger) | |||
|
|||
checkpoint_callback (:class:`CheckpointCallback`): Callback for checkpointing. | |||
checkpoint_callback: Callback for checkpointing. |
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.
why remove the link to the class here?
these should be left how they were
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.
these get generated automatically now because of the type annotations. It still shows in the docs even though it is removed from the docstring. Also, it generates a clickable link (before it was not clickable).
If this is not what you want, I will revert the changes. However, it would mean that in case an argument changes, the developer has to change the type in two places. It could lead to inconsistency.
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.
LGTM 🚀
I rebased and test fails. Is it the MNIST download problem? #859 |
@awaelchli mind rebase? |
fix type links in docs fix types in docs type hints for trainer methods fix fit docs switch to comments readability added sphinx typehints extension wip remove typehints from docstring more type annotations fix spaces
* typehints for trainer fix type links in docs fix types in docs type hints for trainer methods fix fit docs switch to comments readability added sphinx typehints extension wip remove typehints from docstring more type annotations fix spaces * Update trainer.py Co-authored-by: William Falcon <waf2107@columbia.edu>
Before submitting
What does this PR do?
First PR for issue #887 suggested by @hadim
I added typehints to the Trainer class as a first proposal. If the core contributers are happy with the type hint style and docs, I am happy to add more type annotations to the rest of the codebase in future PRs.
This PR includes:
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 🙃