!26063 Disable cache internal parameter in control flow.

Merge pull request !26063 from gaoyong10/runtime_second9
This commit is contained in:
i-robot 2021-11-10 03:21:22 +00:00 committed by Gitee
commit 87919b1f29
1 changed files with 7 additions and 3 deletions

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();