Skip to content

Commit bab1d44

Browse files
NicolasHugfacebook-github-bot
authored andcommitted
[fbsync] Add .. note:: about quantize parameter in quantized models builders (#6021)
Reviewed By: datumbox Differential Revision: D36413364 fbshipit-source-id: f450dfedf0b9f06f7a2a4888d60187dea1618cc9
1 parent 805b62a commit bab1d44

File tree

6 files changed

+53
-10
lines changed

6 files changed

+53
-10
lines changed

torchvision/models/quantization/googlenet.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,10 @@ def googlenet(
143143
) -> QuantizableGoogLeNet:
144144
"""GoogLeNet (Inception v1) model architecture from `Going Deeper with Convolutions <http://arxiv.org/abs/1409.4842>`__.
145145
146-
Note that ``quantize = True`` returns a quantized model with 8 bit
147-
weights. Quantized models only support inference and run on CPUs.
148-
GPU inference is not yet supported
146+
.. note::
147+
Note that ``quantize = True`` returns a quantized model with 8 bit
148+
weights. Quantized models only support inference and run on CPUs.
149+
GPU inference is not yet supported.
149150
150151
Args:
151152
weights (:class:`~torchvision.models.quantization.GoogLeNet_QuantizedWeights` or :class:`~torchvision.models.GoogLeNet_Weights`, optional): The

torchvision/models/quantization/inception.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,10 @@ def inception_v3(
214214
**Important**: In contrast to the other models the inception_v3 expects tensors with a size of
215215
N x 3 x 299 x 299, so ensure your images are sized accordingly.
216216
217-
Note that quantize = True returns a quantized model with 8 bit
218-
weights. Quantized models only support inference and run on CPUs.
219-
GPU inference is not yet supported
217+
.. note::
218+
Note that ``quantize = True`` returns a quantized model with 8 bit
219+
weights. Quantized models only support inference and run on CPUs.
220+
GPU inference is not yet supported.
220221
221222
Args:
222223
weights (:class:`~torchvision.models.quantization.Inception_V3_QuantizedWeights` or :class:`~torchvision.models.Inception_V3_Weights`, optional): The pretrained

torchvision/models/quantization/mobilenetv2.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ def mobilenet_v2(
104104
`MobileNetV2: Inverted Residuals and Linear Bottlenecks
105105
<https://arxiv.org/abs/1801.04381>`_.
106106
107-
Note that quantize = True returns a quantized model with 8 bit
108-
weights. Quantized models only support inference and run on CPUs.
109-
GPU inference is not yet supported
107+
.. note::
108+
Note that ``quantize = True`` returns a quantized model with 8 bit
109+
weights. Quantized models only support inference and run on CPUs.
110+
GPU inference is not yet supported.
110111
111112
Args:
112113
weights (:class:`~torchvision.models.quantization.MobileNet_V2_QuantizedWeights` or :class:`~torchvision.models.MobileNet_V2_Weights`, optional): The

torchvision/models/quantization/mobilenetv3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def mobilenet_v3_large(
200200
.. note::
201201
Note that ``quantize = True`` returns a quantized model with 8 bit
202202
weights. Quantized models only support inference and run on CPUs.
203-
GPU inference is not yet supported
203+
GPU inference is not yet supported.
204204
205205
Args:
206206
weights (:class:`~torchvision.models.quantization.MobileNet_V3_Large_QuantizedWeights` or :class:`~torchvision.models.MobileNet_V3_Large_Weights`, optional): The

torchvision/models/quantization/resnet.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ def resnet18(
270270
"""ResNet-18 model from
271271
`Deep Residual Learning for Image Recognition <https://arxiv.org/abs/1512.03385.pdf>`_
272272
273+
.. note::
274+
Note that ``quantize = True`` returns a quantized model with 8 bit
275+
weights. Quantized models only support inference and run on CPUs.
276+
GPU inference is not yet supported.
277+
273278
Args:
274279
weights (:class:`~torchvision.models.quantization.ResNet18_QuantizedWeights` or :class:`~torchvision.models.ResNet18_Weights`, optional): The
275280
pretrained weights for the model. See
@@ -314,6 +319,11 @@ def resnet50(
314319
"""ResNet-50 model from
315320
`Deep Residual Learning for Image Recognition <https://arxiv.org/abs/1512.03385.pdf>`_
316321
322+
.. note::
323+
Note that ``quantize = True`` returns a quantized model with 8 bit
324+
weights. Quantized models only support inference and run on CPUs.
325+
GPU inference is not yet supported.
326+
317327
Args:
318328
weights (:class:`~torchvision.models.quantization.ResNet50_QuantizedWeights` or :class:`~torchvision.models.ResNet50_Weights`, optional): The
319329
pretrained weights for the model. See
@@ -358,6 +368,11 @@ def resnext101_32x8d(
358368
"""ResNeXt-101 32x8d model from
359369
`Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431.pdf>`_
360370
371+
.. note::
372+
Note that ``quantize = True`` returns a quantized model with 8 bit
373+
weights. Quantized models only support inference and run on CPUs.
374+
GPU inference is not yet supported.
375+
361376
Args:
362377
weights (:class:`~torchvision.models.quantization.ResNet101_32X8D_QuantizedWeights` or :class:`~torchvision.models.ResNet101_32X8D_Weights`, optional): The
363378
pretrained weights for the model. See
@@ -396,6 +411,11 @@ def resnext101_64x4d(
396411
"""ResNeXt-101 64x4d model from
397412
`Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431.pdf>`_
398413
414+
.. note::
415+
Note that ``quantize = True`` returns a quantized model with 8 bit
416+
weights. Quantized models only support inference and run on CPUs.
417+
GPU inference is not yet supported.
418+
399419
Args:
400420
weights (:class:`~torchvision.models.quantization.ResNet101_64X4D_QuantizedWeights` or :class:`~torchvision.models.ResNet101_64X4D_Weights`, optional): The
401421
pretrained weights for the model. See

torchvision/models/quantization/shufflenetv2.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ def shufflenet_v2_x0_5(
208208
`"ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"
209209
<https://arxiv.org/abs/1807.11164>`_.
210210
211+
.. note::
212+
Note that ``quantize = True`` returns a quantized model with 8 bit
213+
weights. Quantized models only support inference and run on CPUs.
214+
GPU inference is not yet supported.
215+
211216
Args:
212217
weights (ShuffleNet_V2_X0_5_QuantizedWeights or ShuffleNet_V2_X0_5_Weights, optional): The pretrained
213218
weights for the model
@@ -240,6 +245,11 @@ def shufflenet_v2_x1_0(
240245
`"ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"
241246
<https://arxiv.org/abs/1807.11164>`_.
242247
248+
.. note::
249+
Note that ``quantize = True`` returns a quantized model with 8 bit
250+
weights. Quantized models only support inference and run on CPUs.
251+
GPU inference is not yet supported.
252+
243253
Args:
244254
weights (ShuffleNet_V2_X1_0_QuantizedWeights or ShuffleNet_V2_X1_0_Weights, optional): The pretrained
245255
weights for the model
@@ -264,6 +274,11 @@ def shufflenet_v2_x1_5(
264274
`"ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"
265275
<https://arxiv.org/abs/1807.11164>`_.
266276
277+
.. note::
278+
Note that ``quantize = True`` returns a quantized model with 8 bit
279+
weights. Quantized models only support inference and run on CPUs.
280+
GPU inference is not yet supported.
281+
267282
Args:
268283
weights (ShuffleNet_V2_X1_5_QuantizedWeights or ShuffleNet_V2_X1_5_Weights, optional): The pretrained
269284
weights for the model
@@ -288,6 +303,11 @@ def shufflenet_v2_x2_0(
288303
`"ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"
289304
<https://arxiv.org/abs/1807.11164>`_.
290305
306+
.. note::
307+
Note that ``quantize = True`` returns a quantized model with 8 bit
308+
weights. Quantized models only support inference and run on CPUs.
309+
GPU inference is not yet supported.
310+
291311
Args:
292312
weights (ShuffleNet_V2_X2_0_QuantizedWeights or ShuffleNet_V2_X2_0_Weights, optional): The pretrained
293313
weights for the model

0 commit comments

Comments
 (0)