diff --git a/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc b/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc index 4f1a291d166759ae56b3ab4d3b645e85b2b0f037..00a68d590765e1cdeaf06645950830592f3d243c 100644 --- a/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc +++ b/paddle/fluid/framework/ir/conv_elementwise_add_mkldnn_fuse_pass.cc @@ -22,11 +22,6 @@ namespace framework { namespace ir { namespace patterns { -static void LinkNodes(Node* from, Node* to) { - from->outputs.push_back(to); - to->inputs.push_back(from); -} - template static void ReplaceAllOccurances(IT s, IT e, FindFunc f, ReplaceFunc r) { if (s == e) return; @@ -47,7 +42,7 @@ static void CorrectGraphEdges(Graph* graph, Node* from, Node* to) { [from](Node* n) { return n == from; }); if (same != std::end(node.inputs)) { - LinkNodes(to, &node); + IR_NODE_LINK_TO(to, (&node)); auto inputs = node.Op()->Inputs();