pytorch
e73eaffd - quant: add QAT fused Linear-Bn1d [1/x]: prepared module (#72431)

Commit
2 years ago
quant: add QAT fused Linear-Bn1d [1/x]: prepared module (#72431) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/72431 Adds support for a fused QAT observed module for `Linear` followed by `BatchNorm1d`. In this PR, only the support for prepared module with fake_quants in the right places is added. A future PR will add support for `convert`, and tests for eager and FX graph mode workflows. Similar to conv-bn, we rescale the weight before applying the fake quant, and undo the rescaling after the linear operation. Test Plan: ``` python test/test_quantization.py TestQuantizeEagerQATNumerics.test_linear_bn ``` Imported from OSS Reviewed By: jerryzh168, raghuramank10000 Differential Revision: D34044427 fbshipit-source-id: 47a519173939ca4824d2c6e6ea7a599764a8ed10 (cherry picked from commit bfc75fe0785e12b0fcc45d58bb04b6da347c1767)
Author
Committer
Parents
Loading