[Quant][fx] Refactor lowering code (part 2) (#74619)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74619
This commit is part 2 of the effort to refactor the
lowering code in _lower_to_native_backend.py. The main change
included in this commit is generalizing the pattern matching
code across different lowering functions. There should be no
change in behavior with this PR.
A future commit will further merge the static and dynamic
lowering code paths.
Test Plan:
python test/test_quantization.py TestQuantizeFx
python test/test_quantization.py TestQuantizeFxOps
Imported from OSS
Reviewed By: jerryzh168
Differential Revision: D35082210
fbshipit-source-id: 7f0347c9449cc9ca68fee5a807c792222f0d1749
(cherry picked from commit 16d34c13c7eb0553680713878b52ece9c8884a1f)