Browse Source

fix the bug of sub graph output tuple include tuple in the control flow sink

tags/v1.6.0
limingqi107 4 years ago
parent
commit
b84a0ef088
1 changed files with 2 additions and 8 deletions
  1. +2
    -8
      mindspore/ccsrc/backend/session/kernel_graph.cc

+ 2
- 8
mindspore/ccsrc/backend/session/kernel_graph.cc View File

@@ -1371,14 +1371,8 @@ bool KernelGraph::IsChildGraphResult(const AnfNodePtr &node) {
std::vector<AnfNodePtr> child_graph_results;
for (const auto &child_graph_result : child_graph_result_) {
MS_EXCEPTION_IF_NULL(child_graph_result);
if (AnfAlgo::CheckPrimitiveType(child_graph_result, prim::kPrimMakeTuple)) {
const auto cnode = child_graph_result->cast<CNodePtr>();
MS_EXCEPTION_IF_NULL(cnode);
const auto &inputs = cnode->inputs();
child_graph_results.insert(child_graph_results.end(), inputs.begin(), inputs.end());
} else {
child_graph_results.emplace_back(child_graph_result);
}
auto outputs = AnfAlgo::GetAllOutput(child_graph_result);
child_graph_results.insert(child_graph_results.end(), outputs.begin(), outputs.end());
}

return find(child_graph_results.begin(), child_graph_results.end(), node) != child_graph_results.end();


Loading…
Cancel
Save