Browse Source

!13820 [MS][LITE][CPU]fix floormod op

From: @fuzhiye
Reviewed-by: @hangangqiang,@zhang_xue_tong
Signed-off-by: @zhang_xue_tong
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
7dffe5a693
2 changed files with 4 additions and 2 deletions
  1. +3
    -1
      mindspore/lite/nnacl/fp32/arithmetic_fp32.c
  2. +1
    -1
      mindspore/lite/test/models_npu.cfg

+ 3
- 1
mindspore/lite/nnacl/fp32/arithmetic_fp32.c View File

@@ -28,7 +28,9 @@ int ElementFloorMod(const float *in0, const float *in1, float *out, int size) {

int ElementFloorModInt(const int *in0, const int *in1, int *out, int size) {
for (int i = 0; i < size; i++) {
out[i] = in0[i] - (in0[i] / in1[i]) * in1[i];
NNACL_ASSERT(in1[i] != 0);
int remainder = in0[i] - (in0[i] / in1[i]) * in1[i];
out[i] = (remainder != 0) && ((in0[i] > 0) != (in1[i] > 0)) ? remainder + in1[i] : remainder;
}
return NNACL_OK;
}


+ 1
- 1
mindspore/lite/test/models_npu.cfg View File

@@ -71,7 +71,7 @@ ml_edu_kit_hand_key_position.onnx 2
#ml_video_edit_oneclick_adaptis.pb #too many subgraphs
densenet.tflite 3
ml_video_edit_enhance.pb 2
ml_video_edit_video_segment_gauss_adaptis_part2_pb2tflite.tflite 3 2
ml_video_edit_video_segment_gauss_adaptis_part2_pb2tflite.tflite 10 2
ml_video_edit_img_segment_adaptise_pb2tflite.tflite 0.5 2
ml_video_edit_imitate_filter.onnx 103
hdc_mobilenet_1w_class.onnx 20


Loading…
Cancel
Save