[Executorch][XNNPACK] Quantized hardtanh (#97387)
Lower Quantized Hardtanh to XNNPACK
Also add symmetric quantization support for hardtanh in executorch backend config
Differential Revision: [D43901222](https://our.internmc.facebook.com/intern/diff/D43901222/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/97387
Approved by: https://github.com/salilsdesai
diff --git a/torch/ao/quantization/backend_config/executorch.py b/torch/ao/quantization/backend_config/executorch.py
index cd4df7f..1b9e31e 100644
--- a/torch/ao/quantization/backend_config/executorch.py
+++ b/torch/ao/quantization/backend_config/executorch.py
@@ -218,9 +218,11 @@
]
share_qparams_ops = [
F.adaptive_avg_pool2d,
+ F.hardtanh,
F.relu,
F.relu6,
torch.nn.AdaptiveAvgPool2d,
+ torch.nn.Hardtanh,
torch.squeeze,
"permute",
"reshape",