From 5397257077751ef5a6d739222a47c09efc844e9d Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Wed, 27 Apr 2022 17:10:38 +0100 Subject: [PATCH] Fix alexnet docs --- docs/source/models/alexnet.rst | 5 +++-- torchvision/models/alexnet.py | 40 +++++++++++++++++----------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/docs/source/models/alexnet.rst b/docs/source/models/alexnet.rst index ea5ff524c7e..50d541632ef 100644 --- a/docs/source/models/alexnet.rst +++ b/docs/source/models/alexnet.rst @@ -3,8 +3,9 @@ AlexNet .. currentmodule:: torchvision.models -The AlexNet model is based on the `ImageNet Classification with Deep Convolutional Neural Networks - `__ +The AlexNet model is based on the +`ImageNet Classification with Deep Convolutional Neural Networks +`__. paper. diff --git a/torchvision/models/alexnet.py b/torchvision/models/alexnet.py index cca6d715640..5be705ca532 100644 --- a/torchvision/models/alexnet.py +++ b/torchvision/models/alexnet.py @@ -72,26 +72,26 @@ class AlexNet_Weights(WeightsEnum): @handle_legacy_interface(weights=("pretrained", AlexNet_Weights.IMAGENET1K_V1)) def alexnet(*, weights: Optional[AlexNet_Weights] = None, progress: bool = True, **kwargs: Any) -> AlexNet: - r"""AlexNet model architecture from the - `ImageNet Classification with Deep Convolutional Neural Networks - `_ paper. - The required minimum input size of the model is 63x63. - - Args: - weights (:class:`~torchvision.models.AlexNet_Weights`, optional): The - pretrained weights to use. See - :class:`~torchvision.models.AlexNet_Weights` below for - more details, and possible values. By default, no pre-trained - weights are used. - progress (bool, optional): If True, displays a progress bar of the - download to stderr. Default is True. - **kwargs: parameters passed to the ``torchvision.models.squeezenet.AlexNet`` - base class. Please refer to the `source code - `_ - for more details about this class. - - .. autoclass:: torchvision.models.AlexNet_Weights - :members: + """AlexNet model architecture from the `ImageNet Classification with Deep Convolutional Neural Networks + `__ paper. + + The required minimum input size of the model is 63x63. + + Args: + weights (:class:`~torchvision.models.AlexNet_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.AlexNet_Weights` below for + more details, and possible values. By default, no pre-trained + weights are used. + progress (bool, optional): If True, displays a progress bar of the + download to stderr. Default is True. + **kwargs: parameters passed to the ``torchvision.models.squeezenet.AlexNet`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.AlexNet_Weights + :members: """ weights = AlexNet_Weights.verify(weights)