W3cubDocs

/PyTorch 2.9

QuantStub

class torch.ao.quantization.QuantStub(qconfig=None) [source]

Quantize stub module, before calibration, this is same as an observer, it will be swapped as nnq.Quantize in convert.

Parameters

qconfig (Optional[QConfig]) – quantization configuration for the tensor, if qconfig is not provided, we will get qconfig from parent modules

© 2025, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.9/generated/torch.ao.quantization.QuantStub.html