-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Prefer local imports for optional dependencies #18551
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
Conversation
⚡ Required checks status: All passing 🟢Groups summary🟢 pytorch_lightning: Tests workflowThese checks are required after the changes to 🟢 pytorch_lightning: Azure GPU
These checks are required after the changes to 🟢 pytorch_lightning: Benchmarks
These checks are required after the changes to 🟢 pytorch_lightning: Docs
These checks are required after the changes to 🟢 mypy
These checks are required after the changes to 🟢 installThese checks are required after the changes to Thank you for your contribution! 💜
|
for more information, see https://pre-commit.ci
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #18551 +/- ##
==========================================
- Coverage 85% 50% -35%
==========================================
Files 427 419 -8
Lines 33376 33229 -147
==========================================
- Hits 28342 16728 -11614
- Misses 5034 16501 +11467 |
What does this PR do?
Part of #12786
The PR moves imports to the local scope to delay the import. An import could be costly, and if a feature is not use it would be redundant to run the import globally. We should consistently follow this style for optional dependencies whenever possible.
📚 Documentation preview 📚: https://pytorch-lightning--18551.org.readthedocs.build/en/18551/
cc @justusschock @awaelchli @Borda