diff --git a/docs/source/models/resnext.rst b/docs/source/models/resnext.rst new file mode 100644 index 00000000000..b2b0eb8694f --- /dev/null +++ b/docs/source/models/resnext.rst @@ -0,0 +1,25 @@ +ResNeXt +======= + +.. currentmodule:: torchvision.models + +The ResNext model is based on the `Aggregated Residual Transformations for Deep Neural Networks `__ +paper. + + +Model builders +-------------- + +The following model builders can be used to instantiate an ResNext model, with or +without pre-trained weights. All the model builders internally rely on the +``torchvision.models.resnet.ResNet`` base class. Please refer to the `source +code +`_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + resnext50_32x4d + resnext101_32x8d diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index 027ab67bfc0..77756b634b2 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -41,6 +41,7 @@ weights: models/efficientnetv2 models/regnet models/resnet + models/resnext models/squeezenet models/vgg models/vision_transformer diff --git a/torchvision/models/resnet.py b/torchvision/models/resnet.py index ae8edaff3c6..3c71938fa1d 100644 --- a/torchvision/models/resnet.py +++ b/torchvision/models/resnet.py @@ -680,12 +680,23 @@ def resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = T def resnext50_32x4d( *, weights: Optional[ResNeXt50_32X4D_Weights] = None, progress: bool = True, **kwargs: Any ) -> ResNet: - r"""ResNeXt-50 32x4d model from - `"Aggregated Residual Transformation for Deep Neural Networks" `_. + """ResNeXt-50 32x4d model from + `Aggregated Residual Transformation for Deep Neural Networks `_. Args: - weights (ResNeXt50_32X4D_Weights, optional): The pretrained weights for the model - progress (bool): If True, displays a progress bar of the download to stderr + weights (:class:`~torchvision.models.ResNeXt50_32X4D_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.ResNext50_32X4D_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.resnet.ResNet`` + base class. Please refer to the `source code + `_ + for more details about this class. + .. autoclass:: torchvision.models.ResNeXt50_32X4D_Weights + :members: """ weights = ResNeXt50_32X4D_Weights.verify(weights) @@ -698,12 +709,23 @@ def resnext50_32x4d( def resnext101_32x8d( *, weights: Optional[ResNeXt101_32X8D_Weights] = None, progress: bool = True, **kwargs: Any ) -> ResNet: - r"""ResNeXt-101 32x8d model from - `"Aggregated Residual Transformation for Deep Neural Networks" `_. + """ResNeXt-101 32x8d model from + `Aggregated Residual Transformation for Deep Neural Networks `_. Args: - weights (ResNeXt101_32X8D_Weights, optional): The pretrained weights for the model - progress (bool): If True, displays a progress bar of the download to stderr + weights (:class:`~torchvision.models.ResNeXt101_32X8D_Weights`, optional): The + pretrained weights to use. See + :class:`~torchvision.models.ResNeXt101_32X8D_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.resnet.ResNet`` + base class. Please refer to the `source code + `_ + for more details about this class. + .. autoclass:: torchvision.models.ResNeXt101_32X8D_Weights + :members: """ weights = ResNeXt101_32X8D_Weights.verify(weights)