diff --git a/docs/source/models/inception_quant.rst b/docs/source/models/inception_quant.rst new file mode 100644 index 00000000000..397fd10df3c --- /dev/null +++ b/docs/source/models/inception_quant.rst @@ -0,0 +1,24 @@ +Quantized InceptionV3 +===================== + +.. currentmodule:: torchvision.models.quantization + +The Quantized Inception model is based on the `Rethinking the Inception Architecture for +Computer Vision `__ paper. + + +Model builders +-------------- + +The following model builders can be used to instanciate a quantized Inception +model, with or without pre-trained weights. All the model builders internally +rely on the ``torchvision.models.quantization.inception.QuantizableInception3`` +base class. Please refer to the `source code +`_ +for more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + inception_v3 diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index 1d349afdbdd..cf0d8d984b1 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -147,6 +147,7 @@ pre-trained weights: :maxdepth: 1 models/googlenet_quant + models/inception_quant models/mobilenetv2_quant | diff --git a/torchvision/models/quantization/inception.py b/torchvision/models/quantization/inception.py index e774f4ce155..54a993200a6 100644 --- a/torchvision/models/quantization/inception.py +++ b/torchvision/models/quantization/inception.py @@ -208,7 +208,7 @@ def inception_v3( **kwargs: Any, ) -> QuantizableInception3: r"""Inception v3 model architecture from - `"Rethinking the Inception Architecture for Computer Vision" `_. + `Rethinking the Inception Architecture for Computer Vision `__. .. note:: **Important**: In contrast to the other models the inception_v3 expects tensors with a size of @@ -219,10 +219,26 @@ def inception_v3( GPU inference is not yet supported Args: - weights (Inception_V3_QuantizedWeights or Inception_V3_Weights, optional): The pretrained - weights for the model - progress (bool): If True, displays a progress bar of the download to stderr - quantize (bool): If True, return a quantized version of the model + weights (:class:`~torchvision.models.quantization.Inception_V3_QuantizedWeights` or :class:`~torchvision.models.Inception_V3_Weights`, optional): The pretrained + weights for the model. See + :class:`~torchvision.models.quantization.Inception_V3_QuantizedWeights` 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. + quantize (bool, optional): If True, return a quantized version of the model. + Default is False. + **kwargs: parameters passed to the ``torchvision.models.quantization.QuantizableInception3`` + base class. Please refer to the `source code + `_ + for more details about this class. + + .. autoclass:: torchvision.models.quantization.Inception_V3_QuantizedWeights + :members: + + .. autoclass:: torchvision.models.Inception_V3_Weights + :members: + :noindex: """ weights = (Inception_V3_QuantizedWeights if quantize else Inception_V3_Weights).verify(weights)