From caa0db3bb0e6a4f8002d3dd3493de05d93e7fbc9 Mon Sep 17 00:00:00 2001 From: wYann Date: Fri, 10 Feb 2023 10:30:53 +0800 Subject: [PATCH] fix error log of kernel object types --- mindspore/ccsrc/kernel/kernel_build_info.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mindspore/ccsrc/kernel/kernel_build_info.cc b/mindspore/ccsrc/kernel/kernel_build_info.cc index d161933f97c..126e9ee4241 100644 --- a/mindspore/ccsrc/kernel/kernel_build_info.cc +++ b/mindspore/ccsrc/kernel/kernel_build_info.cc @@ -86,6 +86,9 @@ TypeId KernelBuildInfo::GetOutputDeviceType(size_t output_index) const { } KernelObjectType KernelBuildInfo::GetInputKernelObjectType(size_t input_index) const { + if (inputs_kernel_object_type_.empty()) { + return KernelObjectType::UNKNOWN_TYPE; + } if (input_index >= inputs_kernel_object_type_.size()) { bool has_tuple_unfold = std::any_of(inputs_kernel_object_type_.begin(), inputs_kernel_object_type_.end(), @@ -101,6 +104,9 @@ KernelObjectType KernelBuildInfo::GetInputKernelObjectType(size_t input_index) c } KernelObjectType KernelBuildInfo::GetOutputKernelObjectType(size_t output_index) const { + if (outputs_kernel_object_type_.empty()) { + return KernelObjectType::UNKNOWN_TYPE; + } if (output_index >= outputs_kernel_object_type_.size()) { bool has_tuple_unfold = std::any_of(outputs_kernel_object_type_.begin(), outputs_kernel_object_type_.end(),