Skip to content

Conversation

@adamjstewart
Copy link
Contributor

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].

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 29, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9286

Note: Links to docs will display an error until the docs builds have been completed.

❗ 2 Active SEVs

There are 2 currently active SEVs. If your PR is affected, please view them below:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the cla signed label Nov 29, 2025
@NicolasHug
Copy link
Member

NicolasHug commented Dec 1, 2025

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.

@adamjstewart
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants