From ecfd2a2fc518c7f2b0b1d7bff0d7b8f7266f000c Mon Sep 17 00:00:00 2001 From: kswang Date: Fri, 25 Sep 2020 09:23:01 +0800 Subject: [PATCH] check kernel exist when select kernel --- mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc b/mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc index 192c4ba51d..353e1bea3e 100644 --- a/mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc +++ b/mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc @@ -148,13 +148,13 @@ void SetKernelInfo(const CNodePtr &kernel_node) { std::vector input_not_cnode_indexes; std::vector output_formats; std::vector output_types; - MS_LOG(INFO) << "SetKernelInfo, CNode Name: " << AnfAlgo::GetCNodeName(kernel_node); GetInputFormatsAndDtypes(kernel_node, &input_formats, &input_types, &input_not_cnode_indexes); - auto kernel_attrs = kernel::CPUKernelFactory::GetInstance().GetSupportedKernelAttrList(AnfAlgo::GetCNodeName(kernel_node)); - + if (kernel_attrs.empty()) { + MS_LOG(EXCEPTION) << "Operator[" << AnfAlgo::GetCNodeName(kernel_node) << "] is not support."; + } int max_type_matched_num = -1; int max_format_matched_num = -1; KernelAttr selected_kernel_attr;