-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Description
🚀 The feature
I propose making torchvision.models._api.WeightsEnum public and adding documentation for it.
Motivation, pitch
TorchGeo is adopting torchvision's new multi-weight support API: torchgeo/torchgeo#917
All of our weights subclass WeightsEnum, but this requires us to import directly from torchvision.models._api. Since this module is prefixed by an underscore, I'm assuming this class is private and subject to change. Also, since this class isn't documented, we have to silence Sphinx warnings about the missing parent class docs.
Alternatives
We could copy-n-paste your WeightsEnum implementation but code duplication is bad and I don't want to deal with legal. We could keep importing from a private module but it may change in the future. Are there any other suggested alternatives for other libraries trying to copy the same design? Maybe this could be moved into TorchData?