WeightsEnum.get_state_dict: fix return type
https://docs.pytorch.org/docs/stable/hub.html#torch.hub.load_state_dict_from_url returns dict[str, Any], which is more specific than Mapping[str, Any].
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9286
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
:heavy_exclamation_mark: 2 Active SEVs
There are 2 currently active SEVs. If your PR is affected, please view them below:
- Dr CI is temporarily not working due to API fairewall
- Pytorch CI is partially paused for the time being (updated 11/27)
This comment was automatically generated by Dr. CI and updates every 15 minutes.
Thanks for the PR, CI has been disabled so I can't validate the changes for now - feel free to ping again in a few days.
Out of curiosity though, what's the actual value of changing the type from Mapping to dict? It's more specific, but why is it better? This is a genuine question, I'm not trying to be snarky.
Mapping supports __getitem__, but does not support __setitem__ (docs). In our case (TorchGeo), we want to be able to later insert more values into this dictionary. The type checker is currently complaining that this isn't allowed.
@NicolasHug anything else needed to merge this PR?