From d2eafcce0574ae3e21f623b387929b6f38e84b81 Mon Sep 17 00:00:00 2001 From: codeWorm Date: Sun, 5 Aug 2018 18:07:05 +0800 Subject: [PATCH] fix result error --- src/operators/kernel/central-arm-func/conv_add_arm_func.h | 7 ++++++- .../kernel/central-arm-func/conv_add_relu_arm_func.h | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/operators/kernel/central-arm-func/conv_add_arm_func.h b/src/operators/kernel/central-arm-func/conv_add_arm_func.h index 15f9b4a178..130db31a7f 100644 --- a/src/operators/kernel/central-arm-func/conv_add_arm_func.h +++ b/src/operators/kernel/central-arm-func/conv_add_arm_func.h @@ -32,7 +32,12 @@ void ConvAddBasic(const FusionConvAddParam ¶m) { int axis = param.Axis(); Tensor *output = param.Output(); math::expand_bias(bias, axis, output->dims()); - output->ShareDataWith(bias); + float *output_data = output->data(); + float *biase_data = bias.data(); + for (int k = 0; k < output->numel(); ++k) { + output_data[k] = biase_data[k]; + } + int groups = param.Groups(); std::vector strides = param.Strides(); std::vector paddings = param.Paddings(); diff --git a/src/operators/kernel/central-arm-func/conv_add_relu_arm_func.h b/src/operators/kernel/central-arm-func/conv_add_relu_arm_func.h index e8929e3e94..363927ab8e 100644 --- a/src/operators/kernel/central-arm-func/conv_add_relu_arm_func.h +++ b/src/operators/kernel/central-arm-func/conv_add_relu_arm_func.h @@ -29,7 +29,12 @@ void ConvAddReluCompute(const FusionConvAddReluParam ¶m) { int axis = param.Axis(); Tensor *output = param.Output(); math::expand_bias(bias, axis, output->dims()); - output->ShareDataWith(bias); + float *output_data = output->data(); + float *biase_data = bias.data(); + for (int k = 0; k < output->numel(); ++k) { + output_data[k] = biase_data[k]; + } + int groups = param.Groups(); std::vector strides = param.Strides(); std::vector paddings = param.Paddings(); -- GitLab