mmpretrain
mmpretrain copied to clipboard
Fix warning with torch.meshgrid
Motivation
torch.meshgrid() has started raising a warning when not called with an explicit indexing parameter:
https://pytorch.org/docs/stable/generated/torch.meshgrid.html
Modification
Provide indexing='ij' to all calls to torch.meshgrid that don't already specify indexing.
Checklist
Before PR:
- [x] Pre-commit or other linting tools are used to fix the potential lint issues.
- [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
- [ ] The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
- [ ] The documentation has been modified accordingly, like docstring or example tutorials.
After PR:
- [x] If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
- [x] CLA has been signed and all committers have signed the CLA in this PR.
Refer to https://github.com/open-mmlab/mmdetection/pull/8090#issuecomment-1140937053 for discussion on PyTorch version support of torch.meshgrid.
I have updated the PR with the same solution as used for mmpose and mmdet. This should be ready to merge now.
Codecov Report
Base: 86.80% // Head: 85.39% // Decreases project coverage by -1.41% :warning:
Coverage data is based on head (
c106dc1) compared to base (877ea30). Patch has no changes to coverable lines.
Additional details and impacted files
@@ Coverage Diff @@
## dev #860 +/- ##
==========================================
- Coverage 86.80% 85.39% -1.42%
==========================================
Files 130 134 +4
Lines 8571 8775 +204
Branches 1478 1435 -43
==========================================
+ Hits 7440 7493 +53
- Misses 909 1058 +149
- Partials 222 224 +2
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 85.33% <ø> (-1.39%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| mmcls/utils/setup_env.py | 95.45% <0.00%> (-4.55%) |
:arrow_down: |
| mmcls/datasets/builder.py | 83.78% <0.00%> (-4.06%) |
:arrow_down: |
| mmcls/apis/train.py | 15.38% <0.00%> (-0.53%) |
:arrow_down: |
| mmcls/utils/__init__.py | 100.00% <0.00%> (ø) |
|
| mmcls/core/hook/__init__.py | 100.00% <0.00%> (ø) |
|
| mmcls/core/evaluation/__init__.py | 100.00% <0.00%> (ø) |
|
| mmcls/utils/distribution.py | 10.52% <0.00%> (ø) |
|
| mmcls/core/hook/wandblogger_hook.py | 18.57% <0.00%> (ø) |
|
| mmcls/core/evaluation/eval_hooks.py | 28.94% <0.00%> (ø) |
|
| mmcls/utils/device.py | 100.00% <0.00%> (ø) |
|
| ... and 2 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.