diff --git a/mindspore/ccsrc/plugin/device/cpu/kernel/broadcast_to_cpu_kernel.cc b/mindspore/ccsrc/plugin/device/cpu/kernel/broadcast_to_cpu_kernel.cc index f632b55ebc8..4eb15167e71 100644 --- a/mindspore/ccsrc/plugin/device/cpu/kernel/broadcast_to_cpu_kernel.cc +++ b/mindspore/ccsrc/plugin/device/cpu/kernel/broadcast_to_cpu_kernel.cc @@ -141,7 +141,7 @@ bool BroadcastToCpuKernelMod::LaunchKernel(const std::vector &inputs std::vector BroadcastToCpuKernelMod::GetOpSupport() { auto iter = func_list_.find(kernel_type_); if (iter == func_list_.end()) { - MS_LOG(EXCEPTION) << "Does not support " << kernel_type_ << "!"; + MS_LOG(EXCEPTION) << "not support " << kernel_type_ << "!"; } std::vector support_list; diff --git a/tests/st/ops/cpu/test_broadcast_to_op.py b/tests/st/ops/cpu/test_broadcast_to_op.py index f70bba66989..925d97ea78a 100644 --- a/tests/st/ops/cpu/test_broadcast_to_op.py +++ b/tests/st/ops/cpu/test_broadcast_to_op.py @@ -115,5 +115,5 @@ def test_broadcast_dyn_invalid_init(): context.set_context(mode=context.GRAPH_MODE, device_target='CPU') ms_shape = (2, -1, 4, 5) x_np = np.random.rand(4, 5).astype(np.float32) - with pytest.raises(ValueError): + with pytest.raises(ValueError) or pytest.raises(RuntimeError): P.BroadcastTo(ms_shape)(Tensor(x_np))