W3cubDocs

/PyTorch 2.9

enable_fake_quant

class torch.ao.quantization.fake_quantize.enable_fake_quant(mod) [source]

Enable fake quantization for the module.

Enable fake quantization for this module, if applicable. Example usage:

# model is any PyTorch model
model.apply(torch.ao.quantization.enable_fake_quant)

© 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.fake_quantize.enable_fake_quant.html