Merge pull request !5211 from ling/bugtags/v1.0.0
| @@ -488,8 +488,7 @@ void AvgPoolingRelu6(const float *input_ptr, float *output_ptr, PoolingParameter | |||||
| } // win_w loop | } // win_w loop | ||||
| } // win_h loop | } // win_h loop | ||||
| #ifdef ENABLE_NEON | #ifdef ENABLE_NEON | ||||
| float32x4_t count = vdupq_n_f32(real_count); | |||||
| tmp_avg = vdivq_f32(tmp_avg, count); | |||||
| tmp_avg = tmp_avg / vdupq_n_f32(real_count); | |||||
| tmp_avg = vmaxq_f32(tmp_avg, zeros); | tmp_avg = vmaxq_f32(tmp_avg, zeros); | ||||
| tmp_avg = vminq_f32(tmp_avg, bounds); | tmp_avg = vminq_f32(tmp_avg, bounds); | ||||
| vst1q_f32(output_ptr + out_channel_offset, tmp_avg); | vst1q_f32(output_ptr + out_channel_offset, tmp_avg); | ||||
| @@ -14,7 +14,7 @@ | |||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #include "nnacl/scale.h" | |||||
| #include "nnacl/fp32/scale.h" | |||||
| #ifdef ENABLE_ARM | #ifdef ENABLE_ARM | ||||
| #include <arm_neon.h> | #include <arm_neon.h> | ||||
| #endif | #endif | ||||
| @@ -25,7 +25,7 @@ void ScaleInner(float *in_data, float *out_data, float *scale, float *offset, in | |||||
| for (int i = 0; i < axis_size; i++) { | for (int i = 0; i < axis_size; i++) { | ||||
| int axis_offset = out_offset + i * inner_size; | int axis_offset = out_offset + i * inner_size; | ||||
| int in_index = 0; | int in_index = 0; | ||||
| #ifdef ENABLE_ARM | |||||
| #ifdef ENABLE_ARM64 | |||||
| for (; in_index < inner_size - 4; in_index += 4) { | for (; in_index < inner_size - 4; in_index += 4) { | ||||
| int in_offset = axis_offset + in_index; | int in_offset = axis_offset + in_index; | ||||
| float32x4_t data = vld1q_f32(in_data + in_offset); | float32x4_t data = vld1q_f32(in_data + in_offset); | ||||
| @@ -48,7 +48,7 @@ void ScaleAxis(float *in_data, float *out_data, float *scale, float *offset, int | |||||
| for (int out = outer_start; out < outer_end; out++) { | for (int out = outer_start; out < outer_end; out++) { | ||||
| int out_offset = out * axis_size; | int out_offset = out * axis_size; | ||||
| int index = 0; | int index = 0; | ||||
| #ifdef ENABLE_ARM | |||||
| #ifdef ENABLE_ARM64 | |||||
| for (; index < axis_size - 4; index += 4) { | for (; index < axis_size - 4; index += 4) { | ||||
| int in_offset = out_offset + index; | int in_offset = out_offset + index; | ||||
| float32x4_t data = vld1q_f32(in_data + in_offset); | float32x4_t data = vld1q_f32(in_data + in_offset); | ||||
| @@ -0,0 +1,30 @@ | |||||
| /** | |||||
| * Copyright 2020 Huawei Technologies Co., Ltd | |||||
| * | |||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| * you may not use this file except in compliance with the License. | |||||
| * You may obtain a copy of the License at | |||||
| * | |||||
| * http://www.apache.org/licenses/LICENSE-2.0 | |||||
| * | |||||
| * Unless required by applicable law or agreed to in writing, software | |||||
| * distributed under the License is distributed on an "AS IS" BASIS, | |||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| * See the License for the specific language governing permissions and | |||||
| * limitations under the License. | |||||
| */ | |||||
| #ifndef MINDSPORE_LITE_NNACL_SCALE_FP32_H_ | |||||
| #define MINDSPORE_LITE_NNACL_SCALE_FP32_H_ | |||||
| #include "nnacl/op_base.h" | |||||
| #include "nnacl/scale.h" | |||||
| #ifdef __cplusplus | |||||
| extern "C" { | |||||
| #endif | |||||
| void DoScale(float *in_data, float *out_data, float *scale, float *offset, int task_id, ScaleParameter *scale_param); | |||||
| #ifdef __cplusplus | |||||
| } | |||||
| #endif | |||||
| #endif // MINDSPORE_LITE_NNACL_SCALE_FP32_H_ | |||||
| @@ -18,7 +18,6 @@ | |||||
| #define MINDSPORE_LITE_NNACL_SCALE_H_ | #define MINDSPORE_LITE_NNACL_SCALE_H_ | ||||
| #include "nnacl/op_base.h" | #include "nnacl/op_base.h" | ||||
| typedef struct ScaleParameter { | typedef struct ScaleParameter { | ||||
| OpParameter op_parameter_; | OpParameter op_parameter_; | ||||
| int outer_size_; | int outer_size_; | ||||
| @@ -28,12 +27,4 @@ typedef struct ScaleParameter { | |||||
| bool const_scale_; | bool const_scale_; | ||||
| } ScaleParameter; | } ScaleParameter; | ||||
| #ifdef __cplusplus | |||||
| extern "C" { | |||||
| #endif | |||||
| void DoScale(float *in_data, float *out_data, float *scale, float *offset, int task_id, ScaleParameter *scale_param); | |||||
| #ifdef __cplusplus | |||||
| } | |||||
| #endif | |||||
| #endif // MINDSPORE_LITE_NNACL_SCALE_H_ | #endif // MINDSPORE_LITE_NNACL_SCALE_H_ | ||||
| @@ -19,7 +19,7 @@ | |||||
| #include <vector> | #include <vector> | ||||
| #include "src/lite_kernel.h" | #include "src/lite_kernel.h" | ||||
| #include "nnacl/scale.h" | |||||
| #include "nnacl/fp32/scale.h" | |||||
| namespace mindspore::kernel { | namespace mindspore::kernel { | ||||