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 7b019b60db98d87e4de9315e96fedca7929d4add..6c619dd2a29ce140c783af0637f51153a1866791 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 @@ -32,12 +32,7 @@ void ConvAddReluCompute(const FusionConvAddReluParam ¶m) { Tensor bias = *param.Bias(); int axis = param.Axis(); Tensor *output = param.Output(); - // math::expand_bias(bias, axis, output->dims()); - 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(); diff --git a/src/operators/kernel/central-arm-func/conv_arm_func.h b/src/operators/kernel/central-arm-func/conv_arm_func.h index 41acb973409d9655ae47a8655c1cb527e9563775..33caded3afaaf125bac9108f2fafeda3d3c2049f 100644 --- a/src/operators/kernel/central-arm-func/conv_arm_func.h +++ b/src/operators/kernel/central-arm-func/conv_arm_func.h @@ -30,7 +30,6 @@ inline void ConvBasic(const ConvParam ¶m) { Tensor filter = *param.Filter(); Tensor *output = param.Output(); output->mutable_data(); - float *bias_data = output->mutable_data(); int groups = param.Groups(); std::vector strides = param.Strides(); std::vector paddings = param.Paddings(); @@ -107,7 +106,7 @@ inline void ConvBasic(const ConvParam ¶m) { Tensor filter_slice = filter.Slice(g * out_step, (g + 1) * out_step); math::matmul(filter_slice, false, col_matrix, false, static_cast(1), &out_slice, - static_cast(0), false, bias_data); + static_cast(0)); } } } diff --git a/src/operators/kernel/central-arm-func/fusion_fc_arm_func.h b/src/operators/kernel/central-arm-func/fusion_fc_arm_func.h index 4a689dfc18e3b8677faa61b5c90cb46321f3f4c3..78a9b6b02679681cf4489ba0a84fd0d7fb116510 100644 --- a/src/operators/kernel/central-arm-func/fusion_fc_arm_func.h +++ b/src/operators/kernel/central-arm-func/fusion_fc_arm_func.h @@ -55,9 +55,9 @@ void FusionFcCompute(const FusionFcParam ¶m) { memory::Copy(out_data + i * classes, input_z_data, sizeof(float) * classes); } - // for (int i = 0; i < out->numel(); i++) { - // DLOG << out_data[i]; - // } + for (int i = 0; i < out->numel(); i++) { + DLOG << out_data[i]; + } math::matmul(x_matrix, false, y_matrix, false, static_cast(1), out, static_cast(1), false, bias_data); PADDLE_MOBILE_ENFORCE(out_dim.size() == 2, " out_dim.size must be 2."); diff --git a/src/operators/kernel/central-arm-func/mul_arm_func.h b/src/operators/kernel/central-arm-func/mul_arm_func.h index 341759a96e1e7216fb9550596d3d3533dd0ab80a..d2da67afe1d2eb746971a2443bdb449eb2b66ec4 100644 --- a/src/operators/kernel/central-arm-func/mul_arm_func.h +++ b/src/operators/kernel/central-arm-func/mul_arm_func.h @@ -59,7 +59,6 @@ void MulCompute(const MulParam ¶m) { const Tensor *input_y = param.InputY(); Tensor *out = param.Out(); out->mutable_data(); - float *bias_data = out->mutable_data(); const Tensor x_matrix = input_x->dims().size() > 2 ? framework::ReshapeToMatrix(*input_x, param.XNumColDims()) @@ -73,7 +72,7 @@ void MulCompute(const MulParam ¶m) { out->Resize({x_matrix.dims()[0], y_matrix.dims()[1]}); } math::matmul(x_matrix, false, y_matrix, false, static_cast(1), - out, static_cast(0), false, bias_data); + out, static_cast(0)); if (out_dim.size() != 2) { out->Resize(out_dim); } diff --git a/src/operators/math/gemm.cpp b/src/operators/math/gemm.cpp index ef1625b72c54b168eb3b58a4126d2500fbfe561f..2b7363b0efa551b83d933d9ab2079dc7dcbaf65d 100644 --- a/src/operators/math/gemm.cpp +++ b/src/operators/math/gemm.cpp @@ -373,9 +373,9 @@ void InnerKernel(int mc, int nc, float alpha, const float *a, const float *b, #endif } } + if (alpha != 1) { WriteWithAlphaBeta(mc, nc, c, C, ldc); - return; } if (beta == 0) {