From 02af6670b6596472867274b595363aa7f20befbc Mon Sep 17 00:00:00 2001 From: tao_yunhao Date: Fri, 25 Sep 2020 14:31:41 +0800 Subject: [PATCH] fix bug of arithmetic_fp16 --- mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_fp16.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_fp16.cc index e015be627d..4cb0c0c36d 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/arithmetic_fp16.cc @@ -156,7 +156,8 @@ int ArithmeticFP16CPUKernel::BroadcastRun(float16_t *input0, float16_t *input1, int ArithmeticFP16CPUKernel::DoArithmetic(int task_id) { int stride_per_thread = UP_DIV(param_->broadcasting_ ? outside_ : param_->out_elements_num_, context_->thread_num_); int cur_offset = stride_per_thread * task_id; - int cur_count = MSMIN(stride_per_thread, param_->out_elements_num_ - cur_offset); + int cur_count = param_->broadcasting_ ? MSMIN(stride_per_thread, outside_ - cur_offset) + : MSMIN(stride_per_thread, param_->out_elements_num_ - cur_offset); int ret = RET_OK; if (param_->broadcasting_) {