提交 9a910501 编写于 作者: J JiabinYang

fix mac compile error in subgraph_splitter

上级 c9995289
...@@ -120,13 +120,20 @@ void UnionContractedNodes(const std::unordered_map<int, BriefNode *> &node_map, ...@@ -120,13 +120,20 @@ void UnionContractedNodes(const std::unordered_map<int, BriefNode *> &node_map,
outputs.insert(node); outputs.insert(node);
} }
// update the dst and src node's inlinks and outlinks. // update the dst and src node's inlinks and outlinks.
#ifdef __clang__
src_node->inlinks = std::vector<BriefNode *>(inputs.begin(), inputs.end());
src_node->outlinks = std::vector<BriefNode *>(outputs.begin(), outputs.end());
dst_node->inlinks.clear();
dst_node->outlinks.clear();
#else
src_node->inlinks = src_node->inlinks =
std::move(std::vector<BriefNode *>(inputs.begin(), inputs.end())); std::move(std::vector<BriefNode *>(inputs.begin(), inputs.end()));
src_node->outlinks = src_node->outlinks =
std::move(std::vector<BriefNode *>(outputs.begin(), outputs.end())); std::move(std::vector<BriefNode *>(outputs.begin(), outputs.end()));
dst_node->inlinks.clear(); dst_node->inlinks.clear();
dst_node->outlinks.clear(); dst_node->outlinks.clear();
#endif
auto inlink_or_outlink_cleaner = [&](std::vector<BriefNode *> &nodes) { auto inlink_or_outlink_cleaner = [&](std::vector<BriefNode *> &nodes) {
for (auto *&n : nodes) { for (auto *&n : nodes) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册