From 4406f902a883e981f38ea9e912f23be3f4c9cb4c Mon Sep 17 00:00:00 2001 From: hjchen2 Date: Fri, 8 Mar 2019 13:49:45 +0800 Subject: [PATCH] Fix 1x1 depthwise conv --- src/operators/math/math_function.cpp | 31 ++++------------------------ 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/src/operators/math/math_function.cpp b/src/operators/math/math_function.cpp index 6cd0514832..4a35dd2a57 100644 --- a/src/operators/math/math_function.cpp +++ b/src/operators/math/math_function.cpp @@ -71,34 +71,11 @@ void MatMul(const framework::Tensor &matrix_a, bool trans_a, a[index++] = tmp[i * n + j]; } } - if (M == 1) { -#ifdef _OPENMP - gemm.Sgemm_omp(M, N, K, alpha, a, K, matrix_b.data(), N, beta, - matrix_out->data(), N, relu, bias); -#else - gemm.Sgemm(M, N, K, alpha, a, K, matrix_b.data(), N, beta, - matrix_out->data(), N, relu, bias); -#endif - } else { - cblas_sgemm(false, false, M, N, K, alpha, a, K, matrix_b.data(), N, - beta, matrix_out->data(), N); - } + cblas_sgemm(false, false, M, N, K, alpha, a, K, matrix_b.data(), N, + beta, matrix_out->data(), N); } else { - if (M == 1) { -#ifdef _OPENMP - gemm.Sgemm_omp(M, N, K, alpha, matrix_a.data(), K, - matrix_b.data(), N, beta, matrix_out->data(), - N, relu, bias); -#else - gemm.Sgemm(M, N, K, alpha, matrix_a.data(), K, - matrix_b.data(), N, beta, matrix_out->data(), N, - relu, bias); -#endif - } else { - cblas_sgemm(false, false, M, N, K, alpha, matrix_a.data(), K, - matrix_b.data(), N, beta, matrix_out->data(), - N); - } + cblas_sgemm(false, false, M, N, K, alpha, matrix_a.data(), K, + matrix_b.data(), N, beta, matrix_out->data(), N); } } -- GitLab