Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ def inject_weight_metadata(app, what, name, obj, options, lines):
"""

if obj.__name__.endswith(("_Weights", "_QuantizedWeights")):

if len(obj) == 0:
lines[:] = ["There are no available pre-trained weights."]
return

lines[:] = [
"The model builder above accepts the following values as the ``weights`` parameter.",
f"``{obj.__name__}.DEFAULT`` is equivalent to ``{obj.DEFAULT}``.",
Expand Down
4 changes: 4 additions & 0 deletions torchvision/models/mnasnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ def mnasnet0_75(*, weights: Optional[MNASNet0_75_Weights] = None, progress: bool
<https://github.com/pytorch/vision/blob/main/torchvision/models/mnasnet.py>`_
for more details about this class.

.. autoclass:: torchvision.models.MNASNet0_75_Weights
:members:
"""
weights = MNASNet0_75_Weights.verify(weights)

Expand Down Expand Up @@ -366,6 +368,8 @@ def mnasnet1_3(*, weights: Optional[MNASNet1_3_Weights] = None, progress: bool =
<https://github.com/pytorch/vision/blob/main/torchvision/models/mnasnet.py>`_
for more details about this class.

.. autoclass:: torchvision.models.MNASNet1_3_Weights
:members:
"""
weights = MNASNet1_3_Weights.verify(weights)

Expand Down