if you want to quantize multiplication, you’ll need to rewrite * to use functional modules: pytorch/functional_modules.py at master · pytorch/pytorch · GitHub 6, an example can be found here: pytorch/common_quantization.py at e61fc1c03b64e61ca4f5bbe278db7ee2cf35e8ff · pytorch/pytorch · GitHub 6
If you want to dequantize then quantize, it’s better to use different instances of quantize module.