Browse Source

!12705 fix memory problem with control sink

From: @Margaret_wangrui
Reviewed-by: @hwhewei,@zh_qh
Signed-off-by: @zh_qh
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
5521e006de
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      mindspore/ccsrc/backend/session/ascend_auto_monad.cc

+ 8
- 0
mindspore/ccsrc/backend/session/ascend_auto_monad.cc View File

@@ -862,6 +862,14 @@ class ExecuteOrderGenerator {
auto kg = target->func_graph()->cast<KernelGraphPtr>();
MS_EXCEPTION_IF_NULL(kg);
kg->ReplaceNode(NOT_NULL(target), NOT_NULL(source));
// replace parameter in graph input
auto &all_graphs = context_.visited_graphs();
for (auto &g : all_graphs) {
auto child_graph_inputs = g->MutableInputs();
std::replace(child_graph_inputs->begin(), child_graph_inputs->end(), target, source);
MS_LOG(DEBUG) << "Replace parameter " << target->DebugString() << " by " << source->DebugString()
<< " in graph " << g->graph_id() << " inputs";
}
iter = exec_order.erase(iter);
continue;
}


Loading…
Cancel
Save