Skip to content

Commit

Permalink
Update docs to not mention 'registration mechanism' - and move corres…
Browse files Browse the repository at this point in the history
…ponding utils out of Beta (#7142)

Co-authored-by: Philip Meier <github.pmeier@posteo.de>
  • Loading branch information
NicolasHug and pmeier committed Feb 1, 2023
1 parent a23f015 commit 6bd04f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
13 changes: 6 additions & 7 deletions docs/source/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,12 @@ behavior, such as batch normalization. To switch between these modes, use
# Set model to eval mode
model.eval()
Model Registration Mechanism
----------------------------

.. betastatus:: registration mechanism
Listing and retrieving available models
---------------------------------------

As of v0.14, TorchVision offers a new model registration mechanism which allows retrieving models
and weights by their names. Here are a few examples on how to use them:
As of v0.14, TorchVision offers a new mechanism which allows listing and
retrieving models and weights by their names. Here are a few examples on how to
use them:

.. code:: python
Expand All @@ -148,7 +147,7 @@ and weights by their names. Here are a few examples on how to use them:
weights_enum2 = get_model_weights(torchvision.models.quantization.mobilenet_v3_large)
assert weights_enum == weights_enum2
Here are the available public methods of the model registration mechanism:
Here are the available public functions to retrieve models and their corresponding weights:

.. currentmodule:: torchvision.models
.. autosummary::
Expand Down
10 changes: 0 additions & 10 deletions torchvision/models/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ def get_weight(name: str) -> WeightsEnum:
"""
Gets the weights enum value by its full name. Example: "ResNet50_Weights.IMAGENET1K_V1"
.. betastatus:: function
Args:
name (str): The name of the weight enum entry.
Expand Down Expand Up @@ -143,8 +141,6 @@ def get_model_weights(name: Union[Callable, str]) -> WeightsEnum:
"""
Returns the weights enum class associated to the given model.
.. betastatus:: function
Args:
name (callable or str): The model builder function or the name under which it is registered.
Expand Down Expand Up @@ -208,8 +204,6 @@ def list_models(module: Optional[ModuleType] = None) -> List[str]:
"""
Returns a list with the names of registered models.
.. betastatus:: function
Args:
module (ModuleType, optional): The module from which we want to extract the available models.
Expand All @@ -226,8 +220,6 @@ def get_model_builder(name: str) -> Callable[..., nn.Module]:
"""
Gets the model name and returns the model builder method.
.. betastatus:: function
Args:
name (str): The name under which the model is registered.
Expand All @@ -246,8 +238,6 @@ def get_model(name: str, **config: Any) -> nn.Module:
"""
Gets the model name and configuration and returns an instantiated model.
.. betastatus:: function
Args:
name (str): The name under which the model is registered.
**config (Any): parameters passed to the model builder method.
Expand Down

0 comments on commit 6bd04f6

Please sign in to comment.