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-001.patch 1.3 kB

1234567891011121314151617181920212223242526272829303132
  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/base/split_base.cc | 9 +++++++++
  7. 1 file changed, 9 insertions(+)
  8. diff --git a/mindspore/lite/src/runtime/kernel/arm/base/split_base.cc b/mindspore/lite/src/runtime/kernel/arm/base/split_base.cc
  9. index 2448a407dd..b96e5aacb8 100644
  10. --- a/mindspore/lite/src/runtime/kernel/arm/base/split_base.cc
  11. +++ b/mindspore/lite/src/runtime/kernel/arm/base/split_base.cc
  12. @@ -50,6 +50,15 @@ int SplitBaseCPUKernel::ReSize() {
  13. param->strides_[i] = param->strides_[i + 1] * input_shape.at(i + 1);
  14. }
  15. + if (input_shape.at(param->split_dim_) == 0) {
  16. + MS_LOG(ERROR) << "input_shape[" << param->split_dim_ << "] must not be zero!";
  17. + return RET_ERROR;
  18. + }
  19. + if (param->strides_[param->split_dim_] == 0) {
  20. + MS_LOG(ERROR) << "param->strides_[" << param->split_dim_ << "] must not be zero!";
  21. + return RET_ERROR;
  22. + }
  23. +
  24. MS_ASSERT(static_cast<size_t>(param->split_dim_) < input_shape.size());
  25. param->split_count_ =
  26. param->strides_[0] * input_shape.at(0) / (input_shape.at(param->split_dim_) * param->strides_[param->split_dim_]);
  27. --
  28. 2.17.1