-
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
refactor and simplify optional imports #2877
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2877 +/- ##
=======================================
+ Coverage 86% 90% +4%
=======================================
Files 83 80 -3
Lines 7861 7185 -676
=======================================
- Hits 6745 6445 -300
+ Misses 1116 740 -376 |
mind update after #2865 |
@Borda adding this to 0.9.x milestone just in case I have a typo, I don't want it to be released :) |
Hello @awaelchli! Thanks for updating this PR.
Comment last updated at 2020-08-24 18:18:41 UTC |
try: | ||
from test_tube import HyperOptArgumentParser | ||
except ImportError: | ||
# TODO: this should be discussed and moved out of this package |
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.
I see it nowhere used here, so it seems we can easily remove it.
try: | ||
from torch.utils.data import IterableDataset | ||
ITERABLE_DATASET_EXISTS = True | ||
except ImportError: | ||
ITERABLE_DATASET_EXISTS = False |
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.
removed this, because iterable dataset is part of torch since 1.2 and we support torch >= 1.3
What does this PR do?
Fixes #2266
refactors code duplication for recurring optional imports like apex, native amp, xla, etc.
it's also backward compatible with e.g. bolts that needs APEX_AVAILABLE etc.
Before submitting
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 🙃