未验证 提交 e9bb3126 编写于 作者: C csy0225 提交者: GitHub

[XPU] Fix matmul + elementwise_add + bn + act fusion that elementwise_add has branch. (#56578)

上级 1c0db09a
......@@ -128,6 +128,9 @@ FcXPUPattern::FcXPUPattern(PDPattern* pattern,
add_out = pattern->NewNode(add_out_repr())
->assert_is_op_output("elementwise_add", "Out")
->assert_var_not_persistable();
if (with_bn_ || !act_type_.empty()) {
add_out->assert_has_n_outputs(1);
}
add->LinksFrom({mul_out, bias}).LinksTo({add_out});
} else {
add_out = mul_out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册