diff --git a/src/operators/math/gemm.cpp b/src/operators/math/gemm.cpp index c9084a9d807ab43ad60b1661b5b1a7ecc67c8479..5d7f5dca44fa3aeffe5f095c4ad27b6d20771f7e 100644 --- a/src/operators/math/gemm.cpp +++ b/src/operators/math/gemm.cpp @@ -2809,8 +2809,13 @@ void Sgemm(int m, int n, int k, float alpha, const float *A, int lda, #else PackMatrixA_6r(mc, KC, mc % MR, &A(i, 0), lda, packedA); #endif - InnerKernelWithBias(mc, nc, alpha, packedA, packedB, beta, packedC, - &C(i, j), ldc, relu, bias + i); + if (bias == nullptr) { + InnerKernelWithBias(mc, nc, alpha, packedA, packedB, beta, packedC, + &C(i, j), ldc, relu, nullptr); + } else { + InnerKernelWithBias(mc, nc, alpha, packedA, packedB, beta, packedC, + &C(i, j), ldc, relu, bias + i); + } } }