From 2d1414760134ea5c535d4d1d87aa79a004269563 Mon Sep 17 00:00:00 2001 From: kswang Date: Thu, 23 Jul 2020 10:29:59 +0800 Subject: [PATCH] cpu support nonop net --- mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc | 6 +++++- mindspore/ccsrc/runtime/device/cpu/cpu_simple_mem_plan.cc | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc b/mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc index 8b144b0440..1d76a4197f 100644 --- a/mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc @@ -186,11 +186,15 @@ BaseRef CPUKernelRuntime::CreatTensorForOutput(const session::KernelWithIndex &k return ret; } return CreatTensorForOutput(node, index, bound_addresses, need_sync_outputs); - } else if (input_node->isa() || input_node->isa()) { + } else if (input_node->isa()) { auto iter = input_map.find(input_node.get()); if (iter != input_map.end()) { return iter->second; } + } else if (input_node->isa()) { + auto value_node = input_node->cast(); + MS_EXCEPTION_IF_NULL(value_node); + return value_node->value(); } return BaseRef(); } diff --git a/mindspore/ccsrc/runtime/device/cpu/cpu_simple_mem_plan.cc b/mindspore/ccsrc/runtime/device/cpu/cpu_simple_mem_plan.cc index 7838e66984..7596817fea 100644 --- a/mindspore/ccsrc/runtime/device/cpu/cpu_simple_mem_plan.cc +++ b/mindspore/ccsrc/runtime/device/cpu/cpu_simple_mem_plan.cc @@ -21,7 +21,7 @@ namespace device { namespace cpu { void CPUSimpleMemPlan::MemPlan(const session::KernelGraph *graph) { MS_EXCEPTION_IF_NULL(graph); - size_t total_mem_size = 0; + size_t total_mem_size = 32; auto kernels = graph->execution_order(); for (const auto &kernel : kernels) { MS_EXCEPTION_IF_NULL(kernel);