diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/sigmoid_cross_entropy_with_logits_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/sigmoid_cross_entropy_with_logits_cpu_kernel.cc index d48457b971..f5f563183c 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/sigmoid_cross_entropy_with_logits_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/sigmoid_cross_entropy_with_logits_cpu_kernel.cc @@ -33,8 +33,10 @@ bool SigmoidCrossEntropyWithLogitsCPUKernel::Launch(const std::vector &outputs) { if (dtype_ == kNumberTypeFloat16) { LaunchKernel(inputs, outputs); - } else if (dtype_ == kNumberTypeFloat32) { + } else if (dtype_ == kNumberTypeFloat32 || dtype_ == kNumberTypeFloat64) { LaunchKernel(inputs, outputs); + } else { + MS_LOG(EXCEPTION) << "input dtype only support float16, float32, float64"; } return true; } diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/sigmoid_cross_entropy_with_logits_grad_cpu_kernel.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/sigmoid_cross_entropy_with_logits_grad_cpu_kernel.cc index 9a17fc8007..ab33de3d4a 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/sigmoid_cross_entropy_with_logits_grad_cpu_kernel.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/sigmoid_cross_entropy_with_logits_grad_cpu_kernel.cc @@ -33,8 +33,10 @@ bool SigmoidCrossEntropyWithLogitsGradCPUKernel::Launch(const std::vector &outputs) { if (dtype_ == kNumberTypeFloat16) { LaunchKernel(inputs, outputs); - } else if (dtype_ == kNumberTypeFloat32) { + } else if (dtype_ == kNumberTypeFloat32 || dtype_ == kNumberTypeFloat64) { LaunchKernel(inputs, outputs); + } else { + MS_LOG(EXCEPTION) << "input dtype only support float16, float32, float64"; } return true; } diff --git a/mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc b/mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc index b800a1b3c8..f841a6e3c4 100644 --- a/mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc +++ b/mindspore/ccsrc/runtime/device/cpu/cpu_kernel_runtime.cc @@ -242,7 +242,8 @@ void CPUKernelRuntime::BindInputTensorAddressPtr(const session::KernelGraph &ker auto tensor_address = tensor->device_address(); MS_EXCEPTION_IF_NULL(address); MS_EXCEPTION_IF_NULL(tensor); - if (tensor_address != nullptr && tensor_address != address) { + if (tensor_address != nullptr && tensor_address != address && + std::dynamic_pointer_cast(tensor_address)->DeviceType() != DeviceAddressType::kCPU) { tensor->data_sync(false); } if (GetTypeByte(TypeIdToType(tensor->data_type())) == GetTypeByte(TypeIdToType(address->type_id_))) { diff --git a/mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc b/mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc index 89257b304b..306b00678d 100644 --- a/mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc +++ b/mindspore/ccsrc/runtime/device/cpu/kernel_select_cpu.cc @@ -234,7 +234,7 @@ void KernelNotSupportException(const AnfNodePtr &kernel_node, const std::vector< operator_info << ") "; } operator_info << "is not support."; - MS_LOG(EXCEPTION) << operator_info.str(); + MS_EXCEPTION(TypeError) << operator_info.str(); } } // namespace bool SelectKernel(const CNodePtr &kernel_node, KernelAttr *selected_kernel_attr,