Unverified Commit 6bd04f65 authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

Update docs to not mention 'registration mechanism' - and move corresponding...


Update docs to not mention 'registration mechanism' - and move corresponding utils out of Beta (#7142)
Co-authored-by: default avatarPhilip Meier <github.pmeier@posteo.de>
parent a23f0158
......@@ -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
......@@ -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::
......
......@@ -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.
......@@ -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.
......@@ -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.
......@@ -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.
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment