Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs to not mention 'registration mechanism' - and move corresponding utils out of Beta #7142

Merged
merged 6 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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