diff --git a/mindspore/ccsrc/runtime/device/launch_mul.cc b/mindspore/ccsrc/runtime/device/launch_mul.cc index c11f1f135e..1f82b1d28e 100644 --- a/mindspore/ccsrc/runtime/device/launch_mul.cc +++ b/mindspore/ccsrc/runtime/device/launch_mul.cc @@ -28,10 +28,10 @@ std::shared_ptr LaunchMul::ObtainMulKernelGraph() { std::vector output_dtypes = {dtype_}; // obtain input & output shapes size_t dtype_size = abstract::TypeIdSize(dtype_); - int64_t shape = total_size_ / dtype_size; if (dtype_size == 0) { MS_LOG(EXCEPTION) << "Divide by zero."; } + int64_t shape = total_size_ / dtype_size; std::vector> input_shapes = {{shape}, {1}}; std::vector> output_shapes = {{static_cast(shape)}}; auto mul_graph = session::SingleKernelGraph::ConstructKernelGraphBasedOnSingleOp(