提交 5996bd39 编写于 作者: T Tomasz Patejko

MKLDNN conv + elementwise_add fusion: graph is corrected based on actual...

MKLDNN conv + elementwise_add fusion: graph is corrected based on actual argument name, not formal argument name
上级 41f3d78f
...@@ -118,7 +118,18 @@ void CorrectGraphEdges(Graph* graph, Node* from, Node* to) { ...@@ -118,7 +118,18 @@ void CorrectGraphEdges(Graph* graph, Node* from, Node* to) {
if (same != std::end(node.inputs)) { if (same != std::end(node.inputs)) {
LinkNodes(to, &node); LinkNodes(to, &node);
node.Op()->SetInput("X", {to->Name()});
auto inputs = node.Op()->Inputs();
std::for_each(std::begin(inputs), std::end(inputs),
[from, to](const std::pair<std::string, std::vector<std::string>>& i) -> void {
auto params = i.second;
std::remove_if(std::begin(params), std::end(params),
std::bind(std::equal_to<std::string>(), from->Name(), std::placeholders::_1));
params.push_back(to->Name());
});
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册