Rate this Page

QuantWrapper#

classtorch.ao.quantization.QuantWrapper(module)[source]#

A wrapper class that wraps the input module, adds QuantStub andDeQuantStub and surround the call to module with call to quant and dequantmodules.

This is used by thequantization utility functions to add the quant anddequant modules, beforeconvert functionQuantStub will just be observer,it observes the input tensor, afterconvert,QuantStubwill be swapped tonnq.Quantize which does actual quantization. SimilarlyforDeQuantStub.