pytorch/torch/_inductor/quantized_lowerings.py
leslie-fang-intel 9319dd1c7c [Quant][Inductor] Enable the lowering of quantized maxpool2d (#105906)
**Summary**
Enable the `dq-maxpool2d-q` pattern match and lower into `torch.ops.quantized.max_pool2d`.

**Test Plan**
```
python -m pytest test_mkldnn_pattern_matcher.py -k test_qmaxpool2d
python -m pytest test_quantized_op.py -k test_max_pool2d_pt2e
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/105906
Approved by: https://github.com/jgong5, https://github.com/eellison
ghstack dependencies: #104580, #104581, #104588, #104590, #105455, #105456, #105639
2023-08-26 08:36:47 +00:00

16 lines
260 B
Python

import torch
def register_quantized_ops():
from . import lowering
quantized = torch.ops.quantized
lowering.add_needs_realized_inputs(
[
quantized.max_pool2d,
]
)
lowering.make_fallback(quantized.max_pool2d)