Skip to content

Commit 9a91050

Browse files
committed
fix mac compile error in subgraph_splitter
1 parent c999528 commit 9a91050

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

paddle/fluid/inference/analysis/subgraph_splitter.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,20 @@ void UnionContractedNodes(const std::unordered_map<int, BriefNode *> &node_map,
120120
outputs.insert(node);
121121
}
122122

123-
// update the dst and src node's inlinks and outlinks.
123+
// update the dst and src node's inlinks and outlinks.
124+
#ifdef __clang__
125+
src_node->inlinks = std::vector<BriefNode *>(inputs.begin(), inputs.end());
126+
src_node->outlinks = std::vector<BriefNode *>(outputs.begin(), outputs.end());
127+
dst_node->inlinks.clear();
128+
dst_node->outlinks.clear();
129+
#else
124130
src_node->inlinks =
125131
std::move(std::vector<BriefNode *>(inputs.begin(), inputs.end()));
126132
src_node->outlinks =
127133
std::move(std::vector<BriefNode *>(outputs.begin(), outputs.end()));
128134
dst_node->inlinks.clear();
129135
dst_node->outlinks.clear();
136+
#endif
130137

131138
auto inlink_or_outlink_cleaner = [&](std::vector<BriefNode *> &nodes) {
132139
for (auto *&n : nodes) {

0 commit comments

Comments
 (0)