Browse Source

fix out of memory question

tags/v1.2.0
wxl 4 years ago
parent
commit
d66ef5f2d0
2 changed files with 2 additions and 4 deletions
  1. +1
    -1
      ge/graph/passes/net_output_pass.cc
  2. +1
    -3
      ge/graph/passes/prune_pass.cc

+ 1
- 1
ge/graph/passes/net_output_pass.cc View File

@@ -458,7 +458,7 @@ Status NetOutputPass::Run(ge::ComputeGraphPtr graph) {
GELOGE(GE_GRAPH_PARAM_NULLPTR, "Compute graph is null."); GELOGE(GE_GRAPH_PARAM_NULLPTR, "Compute graph is null.");
return GE_GRAPH_PARAM_NULLPTR; return GE_GRAPH_PARAM_NULLPTR;
} }
GELOGI("NetOutputPass Run.");
GELOGI("NetOutputPass Run.graph is [%s]", graph->GetName().c_str());
NodePtr output_node = graph->FindFirstNodeMatchType(NETOUTPUT); NodePtr output_node = graph->FindFirstNodeMatchType(NETOUTPUT);
// save user targets node // save user targets node
SaveAndRemoveTargets(graph); SaveAndRemoveTargets(graph);


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

@@ -27,12 +27,11 @@


namespace ge { namespace ge {
Status PrunePass::Run(ge::ComputeGraphPtr graph) { Status PrunePass::Run(ge::ComputeGraphPtr graph) {
GELOGD("PrunePass Start");
GELOGD("PrunePass Start, graph is [%s]", graph->GetName().c_str());
if (graph == nullptr) { if (graph == nullptr) {
GELOGE(GE_GRAPH_ISNULL, "input compute graph is NULL."); GELOGE(GE_GRAPH_ISNULL, "input compute graph is NULL.");
return GE_GRAPH_ISNULL; return GE_GRAPH_ISNULL;
} }

std::vector<NodePtr> out_nodes; std::vector<NodePtr> out_nodes;
std::unordered_set<NodePtr> nodes; std::unordered_set<NodePtr> nodes;
for (NodePtr &node_ptr : graph->GetDirectNode()) { for (NodePtr &node_ptr : graph->GetDirectNode()) {
@@ -42,7 +41,6 @@ Status PrunePass::Run(ge::ComputeGraphPtr graph) {
out_nodes.push_back(node_ptr); out_nodes.push_back(node_ptr);
} }
} }

if (out_nodes.empty()) { if (out_nodes.empty()) {
GELOGW("graph [%s] does not contain NETOUTPUT type node,no return value. Do nothing!", graph->GetName().c_str()); GELOGW("graph [%s] does not contain NETOUTPUT type node,no return value. Do nothing!", graph->GetName().c_str());
return ge::SUCCESS; return ge::SUCCESS;


Loading…
Cancel
Save