Browse Source

!8565 fix compare op shape judge

From: @yankai10
Reviewed-by: @hangangqiang,@zhanghaibo5
Signed-off-by: @hangangqiang
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
6f8b7a7298
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_compare_fp32.cc

+ 4
- 0
mindspore/lite/src/runtime/kernel/arm/fp32/arithmetic_compare_fp32.cc View File

@@ -58,6 +58,10 @@ int ArithmeticCompareCPUKernel::Init() {
int ArithmeticCompareCPUKernel::ReSize() { return RET_OK; }

int ArithmeticCompareCPUKernel::DoExecute(int task_id) {
if (in_tensors_.at(0)->shape() != in_tensors_.at(1)->shape()) {
MS_LOG(ERROR) << "Compare op must inputs have the same shape, support broadcast later! ";
return RET_ERROR;
}
int elements_num = in_tensors_.at(0)->ElementsNum();
int stride = UP_DIV(elements_num, op_parameter_->thread_num_);
int offset = task_id * stride;


Loading…
Cancel
Save