You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
r"""Fuse conv/bn/relu modules in shufflenetv2 model
67
67
68
68
Fuse conv+bn+relu/ conv+relu/conv+bn modules to prepare for quantization.
69
-
Model is modified in place. Note that this operation does not change numerics
70
-
and the model after modification is in floating point
69
+
Model is modified in place.
70
+
71
+
.. note::
72
+
Note that this operation does not change numerics
73
+
and the model after modification is in floating point
71
74
"""
72
75
forname, minself._modules.items():
73
76
ifnamein ["conv1", "conv5"] andmisnotNone:
@@ -205,19 +208,35 @@ def shufflenet_v2_x0_5(
205
208
) ->QuantizableShuffleNetV2:
206
209
"""
207
210
Constructs a ShuffleNetV2 with 0.5x output channels, as described in
208
-
`"ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"
209
-
<https://arxiv.org/abs/1807.11164>`_.
211
+
`ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design
212
+
<https://arxiv.org/abs/1807.11164>`__.
210
213
211
214
.. note::
212
215
Note that ``quantize = True`` returns a quantized model with 8 bit
213
216
weights. Quantized models only support inference and run on CPUs.
214
217
GPU inference is not yet supported.
215
218
216
219
Args:
217
-
weights (ShuffleNet_V2_X0_5_QuantizedWeights or ShuffleNet_V2_X0_5_Weights, optional): The pretrained
218
-
weights for the model
219
-
progress (bool): If True, displays a progress bar of the download to stderr
220
-
quantize (bool): If True, return a quantized version of the model
220
+
weights (:class:`~torchvision.models.quantization.ShuffleNet_V2_X0_5_QuantizedWeights` or :class:`~torchvision.models.ShuffleNet_V2_X0_5_Weights`, optional): The
221
+
pretrained weights for the model. See
222
+
:class:`~torchvision.models.quantization.ShuffleNet_V2_X0_5_QuantizedWeights` below for
223
+
more details, and possible values. By default, no pre-trained
224
+
weights are used.
225
+
progress (bool, optional): If True, displays a progress bar of the download to stderr.
226
+
Default is True.
227
+
quantize (bool, optional): If True, return a quantized version of the model.
228
+
Default is False.
229
+
**kwargs: parameters passed to the ``torchvision.models.quantization.ShuffleNet_V2_X0_5_QuantizedWeights``
Constructs a ShuffleNetV2 with 1.0x output channels, as described in
245
-
`"ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"
246
-
<https://arxiv.org/abs/1807.11164>`_.
264
+
`ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design
265
+
<https://arxiv.org/abs/1807.11164>`__.
247
266
248
267
.. note::
249
268
Note that ``quantize = True`` returns a quantized model with 8 bit
250
269
weights. Quantized models only support inference and run on CPUs.
251
270
GPU inference is not yet supported.
252
271
253
272
Args:
254
-
weights (ShuffleNet_V2_X1_0_QuantizedWeights or ShuffleNet_V2_X1_0_Weights, optional): The pretrained
255
-
weights for the model
256
-
progress (bool): If True, displays a progress bar of the download to stderr
257
-
quantize (bool): If True, return a quantized version of the model
273
+
weights (:class:`~torchvision.models.quantization.ShuffleNet_V2_X1_0_QuantizedWeights` or :class:`~torchvision.models.ShuffleNet_V2_X1_0_Weights`, optional): The
274
+
pretrained weights for the model. See
275
+
:class:`~torchvision.models.quantization.ShuffleNet_V2_X1_0_QuantizedWeights` below for
276
+
more details, and possible values. By default, no pre-trained
277
+
weights are used.
278
+
progress (bool, optional): If True, displays a progress bar of the download to stderr.
279
+
Default is True.
280
+
quantize (bool, optional): If True, return a quantized version of the model.
281
+
Default is False.
282
+
**kwargs: parameters passed to the ``torchvision.models.quantization.ShuffleNet_V2_X1_0_QuantizedWeights``
Constructs a ShuffleNetV2 with 1.5x output channels, as described in
274
-
`"ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"
275
-
<https://arxiv.org/abs/1807.11164>`_.
309
+
`ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design
310
+
<https://arxiv.org/abs/1807.11164>`__.
276
311
277
312
.. note::
278
313
Note that ``quantize = True`` returns a quantized model with 8 bit
279
314
weights. Quantized models only support inference and run on CPUs.
280
315
GPU inference is not yet supported.
281
316
282
317
Args:
283
-
weights (ShuffleNet_V2_X1_5_QuantizedWeights or ShuffleNet_V2_X1_5_Weights, optional): The pretrained
284
-
weights for the model
285
-
progress (bool): If True, displays a progress bar of the download to stderr
286
-
quantize (bool): If True, return a quantized version of the model
318
+
weights (:class:`~torchvision.models.quantization.ShuffleNet_V2_X1_5_QuantizedWeights` or :class:`~torchvision.models.ShuffleNet_V2_X1_5_Weights`, optional): The
319
+
pretrained weights for the model. See
320
+
:class:`~torchvision.models.quantization.ShuffleNet_V2_X1_5_QuantizedWeights` below for
321
+
more details, and possible values. By default, no pre-trained
322
+
weights are used.
323
+
progress (bool, optional): If True, displays a progress bar of the download to stderr.
324
+
Default is True.
325
+
quantize (bool, optional): If True, return a quantized version of the model.
326
+
Default is False.
327
+
**kwargs: parameters passed to the ``torchvision.models.quantization.ShuffleNet_V2_X1_5_QuantizedWeights``
Constructs a ShuffleNetV2 with 2.0x output channels, as described in
303
-
`"ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design"
304
-
<https://arxiv.org/abs/1807.11164>`_.
354
+
`ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design
355
+
<https://arxiv.org/abs/1807.11164>`__.
305
356
306
357
.. note::
307
358
Note that ``quantize = True`` returns a quantized model with 8 bit
308
359
weights. Quantized models only support inference and run on CPUs.
309
360
GPU inference is not yet supported.
310
361
311
362
Args:
312
-
weights (ShuffleNet_V2_X2_0_QuantizedWeights or ShuffleNet_V2_X2_0_Weights, optional): The pretrained
313
-
weights for the model
314
-
progress (bool): If True, displays a progress bar of the download to stderr
315
-
quantize (bool): If True, return a quantized version of the model
363
+
weights (:class:`~torchvision.models.quantization.ShuffleNet_V2_X2_0_QuantizedWeights` or :class:`~torchvision.models.ShuffleNet_V2_X2_0_Weights`, optional): The
364
+
pretrained weights for the model. See
365
+
:class:`~torchvision.models.quantization.ShuffleNet_V2_X2_0_QuantizedWeights` below for
366
+
more details, and possible values. By default, no pre-trained
367
+
weights are used.
368
+
progress (bool, optional): If True, displays a progress bar of the download to stderr.
369
+
Default is True.
370
+
quantize (bool, optional): If True, return a quantized version of the model.
371
+
Default is False.
372
+
**kwargs: parameters passed to the ``torchvision.models.quantization.ShuffleNet_V2_X2_0_QuantizedWeights``
0 commit comments