Browse Source

!26063 Disable cache internal parameter in control flow.

Merge pull request !26063 from gaoyong10/runtime_second9
tags/v1.6.0
i-robot Gitee 4 years ago
parent
commit
87919b1f29
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      mindspore/ccsrc/backend/session/session_basic.cc

+ 7
- 3
mindspore/ccsrc/backend/session/session_basic.cc View File

@@ -570,9 +570,13 @@ AnfNodePtr SessionBasic::CreateParameterFromTuple(const AnfNodePtr &node, Kernel

for (size_t i = 0; i < parameters.size(); ++i) {
const auto &parameter = parameters[i];
// In control flow, if the input of the cnode is a call node, it will be processed as a make_tuple input,
// which needs to be linked when processing the internal node.
graph->CacheInternalParameterToFrontNode(parameter, {node, i});
auto context_ptr = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context_ptr);
if (context_ptr->get_param<bool>(MS_CTX_ENABLE_MINDRT) == true) {
// In control flow, if the input of the cnode is a call node, it will be processed as a make_tuple input,
// which needs to be linked when processing the internal node.
graph->CacheInternalParameterToFrontNode(parameter, {node, i});
}
auto valid_inputs = graph->MutableValidInputs();
MS_EXCEPTION_IF_NULL(valid_inputs);
auto graph_inputs = graph->MutableInputs();


Loading…
Cancel
Save