From c80dd2dba39abfd5bfecc6b739a21fabf19a617c Mon Sep 17 00:00:00 2001 From: wang_shaocong Date: Mon, 30 Nov 2020 10:44:31 +0800 Subject: [PATCH] fix bug of resize --- mindspore/lite/nnacl/int8/resize_int8.c | 2 +- mindspore/lite/src/ops/populate/strided_slice_populate.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mindspore/lite/nnacl/int8/resize_int8.c b/mindspore/lite/nnacl/int8/resize_int8.c index defbfca21e..bc164a8fec 100644 --- a/mindspore/lite/nnacl/int8/resize_int8.c +++ b/mindspore/lite/nnacl/int8/resize_int8.c @@ -93,7 +93,7 @@ int ResizeBilinearWithFloatScaleInt8(const int8_t *input_ptr, int8_t *output_ptr int input_rt_index = (y_upper_value * in_w + x_upper_value) * channel; int c = 0; #ifdef ENABLE_ARM - for (; c < channel; c += 4) { + for (; c <= channel - 4; c += 4) { float32x4_t in_lb; in_lb[0] = (float)in_b_ptr[input_lb_index]; in_lb[1] = (float)in_b_ptr[input_lb_index + 1]; diff --git a/mindspore/lite/src/ops/populate/strided_slice_populate.h b/mindspore/lite/src/ops/populate/strided_slice_populate.h index 6876657c6f..a3596a7bd2 100644 --- a/mindspore/lite/src/ops/populate/strided_slice_populate.h +++ b/mindspore/lite/src/ops/populate/strided_slice_populate.h @@ -14,6 +14,9 @@ * limitations under the License. */ +#ifndef LITE_MINDSPORE_LITE_C_OPS_OP_STRIDED_SLICE_POPULATE_H +#define LITE_MINDSPORE_LITE_C_OPS_OP_STRIDED_SLICE_POPULATE_H + #include "src/ops/arithmetic.h" namespace mindspore { @@ -23,3 +26,4 @@ OpParameter *PopulateStridedSliceParameter(const mindspore::lite::PrimitiveC *pr } // namespace lite } // namespace mindspore +#endif