-
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
LightningModule.log_dict: fix type hints for MetricCollection #18646
LightningModule.log_dict: fix type hints for MetricCollection #18646
Conversation
By extension, the |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #18646 +/- ##
==========================================
- Coverage 85% 50% -35%
==========================================
Files 427 419 -8
Lines 33432 33264 -168
==========================================
- Hits 28449 16770 -11679
- Misses 4983 16494 +11511 |
Hmm, I assume we don't want to pass MetricCollection into lightning.fabric? And we don't want to turn |
Seems like there's one more instance to update: src/lightning/pytorch/core/module.py:611: error: Argument "metrics" to "log_dict" of "Fabric" has incompatible type "Mapping[str, Metric | Tensor | int | float] | MetricCollection"; expected "Mapping[str, Any]" [arg-type] |
Ah sorry, I just saw your previous message. I would suggest that the error is ignored and you could propose making it a mapping subtype in torchmetrics in the meantime |
What does this PR do?
Fixes #18641
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:
Reviewer checklist
📚 Documentation preview 📚: https://pytorch-lightning--18646.org.readthedocs.build/en/18646/