diff --git a/mindspore/ccsrc/device/cpu/cpu_kernel_runtime.cc b/mindspore/ccsrc/device/cpu/cpu_kernel_runtime.cc index 1dcddfa9946f4cd391d96980f1d420a7daec41e0..67328f04c27f7abba8835936d7ef26399d98b2fa 100644 --- a/mindspore/ccsrc/device/cpu/cpu_kernel_runtime.cc +++ b/mindspore/ccsrc/device/cpu/cpu_kernel_runtime.cc @@ -44,8 +44,7 @@ void CPUKernelRuntime::AssignKernelAddress(session::KernelGraph *kernel_graph) { void CPUKernelRuntime::AssignValueNodeAddress(session::KernelGraph *kernel_graph) { MS_EXCEPTION_IF_NULL(kernel_graph); size_t type_size = sizeof(float); - for (auto &item : kernel_graph->value_nodes()) { - auto item_node = item.first; + for (auto &item_node : kernel_graph->graph_value_nodes()) { MS_EXCEPTION_IF_NULL(item_node); if (item_node->isa()) { auto value_node = item_node->cast(); diff --git a/mindspore/ccsrc/session/session_basic.cc b/mindspore/ccsrc/session/session_basic.cc index db6257c815ad6192e7eaaacf53546757ba21e913..15a66c63ab778c17db437c4c4c997bc86620b236 100644 --- a/mindspore/ccsrc/session/session_basic.cc +++ b/mindspore/ccsrc/session/session_basic.cc @@ -589,7 +589,7 @@ KernelGraphPtr SessionBasic::ConstructKernelGraph(const AnfNodePtrList &lst, con // add a make_tuple at the end of graph as output graph->set_output(ConstructOutput(outputs, graph)); MS_EXCEPTION_IF_NULL(context_); - FuncGraphManagerPtr manager = context_->manager(); + FuncGraphManagerPtr manager = MakeManager({graph}); if (manager) { manager->AddFuncGraph(graph); graph->set_manager(manager);