You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mssa-2021-003.patch 1.1 kB

123456789101112131415161718192021222324252627
  1. From e0cbe113745a38be7b3afa0dff63a819e4490005 Mon Sep 17 00:00:00 2001
  2. From: lzk <liuzhongkai2@huawei.com>
  3. Date: Fri, 21 May 2021 01:11:07 -0700
  4. Subject: [PATCH] div 0 bug fix
  5. ---
  6. mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc | 4 ++++
  7. 1 file changed, 4 insertions(+)
  8. diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc
  9. index 044fd170e1..f1e45d47e0 100644
  10. --- a/mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc
  11. +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/reduce_fp32.cc
  12. @@ -117,6 +117,10 @@ int ReduceCPUKernel::Run() {
  13. outer_size_ = outer_sizes_.at(i);
  14. inner_size_ = inner_sizes_.at(i);
  15. axis_size_ = axis_sizes_.at(i);
  16. + if (axis_size_ == 0) {
  17. + MS_LOG(ERROR) << "axis_size_ is must not be zero!";
  18. + return RET_ERROR;
  19. + }
  20. auto error_code = ParallelLaunch(static_cast<const lite::InnerContext *>(this->context_)->thread_pool_, ReduceImpl,
  21. this, context_->thread_num_);
  22. if (error_code != RET_OK) {
  23. --
  24. 2.17.1