From 9a9105018d6acf71bec681d8fdcd3fc6559b80ac Mon Sep 17 00:00:00 2001 From: JiabinYang Date: Fri, 14 Sep 2018 04:01:04 +0000 Subject: [PATCH] fix mac compile error in subgraph_splitter --- paddle/fluid/inference/analysis/subgraph_splitter.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/inference/analysis/subgraph_splitter.cc b/paddle/fluid/inference/analysis/subgraph_splitter.cc index c3a2dbf9d1..b879067d2f 100644 --- a/paddle/fluid/inference/analysis/subgraph_splitter.cc +++ b/paddle/fluid/inference/analysis/subgraph_splitter.cc @@ -120,13 +120,20 @@ void UnionContractedNodes(const std::unordered_map &node_map, 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(inputs.begin(), inputs.end()); + src_node->outlinks = std::vector(outputs.begin(), outputs.end()); + dst_node->inlinks.clear(); + dst_node->outlinks.clear(); +#else src_node->inlinks = std::move(std::vector(inputs.begin(), inputs.end())); src_node->outlinks = std::move(std::vector(outputs.begin(), outputs.end())); dst_node->inlinks.clear(); dst_node->outlinks.clear(); +#endif auto inlink_or_outlink_cleaner = [&](std::vector &nodes) { for (auto *&n : nodes) { -- GitLab