提交 3f1d0234 编写于 作者: J joanna.wozna.intel 提交者: Tao Luo

Fix conv2d+dequantize squash for residual fusion (#19545)

* Fix conv2d+dequantize squash for residual fusion

test=develop

* Change condition

test=develop
上级 a35557d8
...@@ -177,7 +177,10 @@ void CPUQuantizeSquashPass::ConvDequantSquash(Graph* graph) const { ...@@ -177,7 +177,10 @@ void CPUQuantizeSquashPass::ConvDequantSquash(Graph* graph) const {
GET_IR_NODE_FROM_SUBGRAPH(dequant_out, dequant_out, conv_dequant_pattern); GET_IR_NODE_FROM_SUBGRAPH(dequant_out, dequant_out, conv_dequant_pattern);
// if conv2d has one output // if conv2d has one output
if (conv_out->outputs.size() == 1) { // and there is no fuse residual connection
// because residual fusion does not support force output with fp32
if (conv_out->outputs.size() == 1 &&
!(conv_op->Op()->GetAttrIfExists<bool>("fuse_residual_connection"))) {
conv_op->Op()->SetAttr("force_fp32_output", true); conv_op->Op()->SetAttr("force_fp32_output", true);
conv_op->Op()->SetOutput("Output", conv_op->Op()->SetOutput("Output",
std::vector<std::string>({dequant_out->Name()})); std::vector<std::string>({dequant_out->Name()}));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册