提交 e1f4fd86 编写于 作者: 卢旭辉

Merge branch 'matmul_fix' into 'master'

Fix micro matmul bias access bug

See merge request applied-machine-learning/sysml/mace!1304
......@@ -27,9 +27,15 @@ MaceStatus MatMulOp::OnInit() {
transpose_b_ = GetArgByName("transpose_b", false);
input_a_ = GetInputData<mifloat>(INPUT_A);
input_b_ = GetInputData<mifloat>(INPUT_B);
bias_ = GetInputSize() > 3 ? GetInputData<mifloat>(BIAS) : NULL;
output_ = GetOutputData<mifloat>(OUTPUT);
bias_ = NULL;
if (GetInputSize() >= 3) {
bias_ = GetInputData<mifloat>(BIAS);
bias_dim_size_ = GetInputShapeDimSize(BIAS);
bias_dims_ = GetInputShapeDims(BIAS);
}
input_a_dim_size_ = GetInputShapeDimSize(INPUT_A);
input_b_dim_size_ = GetInputShapeDimSize(INPUT_B);
......
......@@ -98,10 +98,10 @@ MaceStatus Gemv<mifloat>::Compute(const mifloat *lhs_data,
float sum2 = 0;
float sum3 = 0;
if (bias_data != NULL) {
sum0 = bias_data[0];
sum1 = bias_data[1];
sum2 = bias_data[2];
sum3 = bias_data[3];
sum0 = bias_data[h + 0];
sum1 = bias_data[h + 1];
sum2 = bias_data[h + 2];
sum3 = bias_data[h + 3];
}
const int32_t lhs_h_base0 = (lhs_b_base + h) * lhs_width;
const int32_t lhs_h_base1 = lhs_h_base0 + lhs_width;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册