Browse Source

Remove isoloate node

tags/v1.2.0
zhangxiaokun 3 years ago
parent
commit
d61420142e
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      ge/graph/passes/subgraph_const_migration_pass.cc

+ 5
- 1
ge/graph/passes/subgraph_const_migration_pass.cc View File

@@ -412,7 +412,11 @@ Status SubgraphConstMigrationPass::AttachParallelNode(const ComputeGraphPtr &gra
const auto &out_anchor = in_anchor->GetPeerOutAnchor();
if (out_anchor != nullptr) { // Break useless old link.
GE_CHK_GRAPH_STATUS_RET(GraphUtils::RemoveEdge(out_anchor, in_anchor), "Remove edge failed");
GELOGI("Remove Edge: %s %s", out_anchor->GetOwnerNode()->GetName().c_str(), func_node->GetName().c_str());
const auto owner_node = out_anchor->GetOwnerNode();
GELOGI("Remove Edge: %s %s", owner_node->GetName().c_str(), func_node->GetName().c_str());
if (owner_node->GetInAllNodes().empty() && owner_node->GetOutAllNodes().empty()) {
graph->RemoveNode(owner_node);
}
}
GE_CHK_GRAPH_STATUS_RET(GraphUtils::AddEdge(const_node->GetOutDataAnchor(kZeroIndex), in_anchor), "Add edge failed");
GELOGI("Add Edge: %s %s, index: %u", const_node->GetName().c_str(), func_node->GetName().c_str(), parent_index);


Loading…
Cancel
Save