mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
graph mode: add hardswish inplace handling (#40284)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/40284 Adds graph mode handling for inplace hardswish, and test coverage for functional hardswish. Test Plan: ``` python test/test_quantization.py TestQuantizeScriptPTSQOps.test_hardswish ``` Imported from OSS Differential Revision: D22140628 fbshipit-source-id: 55a514f7dc1130d510f69ee4e611d7cb5e08d02e
This commit is contained in:
committed by
Facebook GitHub Bot
parent
c6dbfcaf9e
commit
ab8a99bd36
@ -848,6 +848,9 @@ graph(%a_quant, %alpha, %scale, %input_scale, %r_scale, %r_zero_point, %r_dtype)
|
||||
auto hardswish = getObservedQParamOpFusionInfo(
|
||||
"aten::hardswish", "quantized::hardswish", {}, {});
|
||||
|
||||
auto hardswish_ = getObservedQParamOpFusionInfo(
|
||||
"aten::hardswish_", "quantized::hardswish", {}, {});
|
||||
|
||||
auto layer_norm = getObservedQParamOpFusionInfo(
|
||||
"aten::layer_norm",
|
||||
"quantized::layer_norm",
|
||||
@ -968,6 +971,7 @@ graph(%a_quant, %alpha, %scale, %input_scale, %r_scale, %r_zero_point, %r_dtype)
|
||||
{"quantized::mul", mul, quantized_mul},
|
||||
{"quantized::mul", inplace_mul, quantized_mul},
|
||||
hardswish,
|
||||
hardswish_,
|
||||
layer_norm,
|
||||
group_norm,
|
||||
instance_norm,
|
||||
|
Reference in New Issue
Block a user