Skip to content

[DOC] Add quantized inception updated documentation. #6005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 13, 2022
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
24 changes: 24 additions & 0 deletions docs/source/models/inception_quant.rst
Original file line number Diff line number Diff line change
@@ -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 <https://arxiv.org/abs/1512.00567>`__ 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
<https://github.com/pytorch/vision/blob/main/torchvision/models/quantization/inception.py>`_
for more details about this class.

.. autosummary::
:toctree: generated/
:template: function.rst

inception_v3
1 change: 1 addition & 0 deletions docs/source/models_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ pre-trained weights:
:maxdepth: 1

models/googlenet_quant
models/inception_quant
models/mobilenetv2_quant

|
Expand Down
26 changes: 21 additions & 5 deletions torchvision/models/quantization/inception.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def inception_v3(
**kwargs: Any,
) -> QuantizableInception3:
r"""Inception v3 model architecture from
`"Rethinking the Inception Architecture for Computer Vision" <http://arxiv.org/abs/1512.00567>`_.
`Rethinking the Inception Architecture for Computer Vision <http://arxiv.org/abs/1512.00567>`__.

.. note::
**Important**: In contrast to the other models the inception_v3 expects tensors with a size of
Expand All @@ -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
<https://github.com/pytorch/vision/blob/main/torchvision/models/quantization/inception.py>`_
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)

Expand Down