Browse Source

!231 while+netoutput with known subgraph

Merge pull request !231 from weiyang/development
tags/v1.1.0
mindspore-ci-bot Gitee 4 years ago
parent
commit
d9d9f4e293
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      ge/graph/passes/subgraph_pass.cc

+ 3
- 1
ge/graph/passes/subgraph_pass.cc View File

@@ -146,11 +146,13 @@ Status SubgraphPass::SubgraphOutputNode(const ComputeGraphPtr &graph, const Node
// 2. AtomicOp->NetOutput in subgraph // 2. AtomicOp->NetOutput in subgraph
// 3. OutputContinuesRequiredOp->NetOutput in subgraph // 3. OutputContinuesRequiredOp->NetOutput in subgraph
// 4. Data->NetOutput in subgraph but parent_node is not while // 4. Data->NetOutput in subgraph but parent_node is not while
// 5. While->NetOutput in known subgraph
std::string op_type; std::string op_type;
bool insert_flag = NodeUtils::GetConstOpType(in_node, op_type) || bool insert_flag = NodeUtils::GetConstOpType(in_node, op_type) ||
IsAtomicRequired(in_node, peer_out_anchor->GetIdx()) || IsOutputContinuesRequired(in_node) || IsAtomicRequired(in_node, peer_out_anchor->GetIdx()) || IsOutputContinuesRequired(in_node) ||
((in_node->GetType() == DATA) && (kWhileOpTypes.count(graph->GetParentNode()->GetType()) == 0)) || ((in_node->GetType() == DATA) && (kWhileOpTypes.count(graph->GetParentNode()->GetType()) == 0)) ||
(NodeUtils::IsDynamicShape(node) && (kWhileOpTypes.count(in_node->GetType()) != 0));
(!graph->GetGraphUnknownFlag() && NodeUtils::IsDynamicShape(node) &&
(kWhileOpTypes.count(in_node->GetType()) != 0));
if (insert_flag) { if (insert_flag) {
GELOGD("Insert MemcpyAsync node between %s and %s.", in_node->GetName().c_str(), node->GetName().c_str()); GELOGD("Insert MemcpyAsync node between %s and %s.", in_node->GetName().c_str(), node->GetName().c_str());
std::string name = node->GetName() + "_input_" + std::to_string(in_data_anchor->GetIdx()) + "_Memcpy"; std::string name = node->GetName() + "_input_" + std::to_string(in_data_anchor->GetIdx()) + "_Memcpy";


Loading…
Cancel
Save