[quant][graphmode][fx] Add reference quantized conv module (#63828)
authorJerry Zhang <jerryzh@fb.com>
Mon, 30 Aug 2021 21:21:39 +0000 (14:21 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 30 Aug 2021 21:23:17 +0000 (14:23 -0700)
commit8f88f797dbff54aa4d2b153e9f0dc87794e4cf38
tree2ef11adf08b578473202c21f0442e7a56fd59584
parent65050ec9247ef4566d035bfe3d0c58eb6e7f091b
[quant][graphmode][fx] Add reference quantized conv module (#63828)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63828

Added reference quantized conv module for the custom backend flow, the reference quantized module will
have the following code:
```
        w(float) -- quant - dequant \
        x(float) ------------- F.conv2d ---
```
In the full model, we will see
```
        w(float) -- quant - *dequant \
        x -- quant --- *dequant --  *F.conv2d --- *quant - dequant
```
and the backend should be able to fuse the ops with `*` into a quantized linear

Test Plan:
python test/test_quantization.py TestQuantizeFx.test_conv_linear_reference

Imported from OSS

Reviewed By: vkuzo

Differential Revision: D30504749

fbshipit-source-id: e1d8c43a0e0d6d9ea2375b8ca59a9c0f455514fb
test/quantization/core/test_quantized_module.py
test/quantization/fx/test_quantize_fx.py
torch/nn/intrinsic/quantized/_reference/__init__.py [deleted file]
torch/nn/intrinsic/quantized/_reference/modules/__init__.py [deleted file]
torch/nn/intrinsic/quantized/_reference/modules/conv_relu.py [deleted file]
torch/nn/quantized/_reference/modules/conv.py
torch/quantization/fx/quantization_patterns.py
torch/quantization/quantization_mappings.py