Skip to content

Commit 0620b5b

Browse files
authored
Merge pull request #52 from JDAI-CV/develop
Fix some missing cases for binconv method
2 parents c472484 + 22fe7c4 commit 0620b5b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: dabnn/layers/BinConv.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ BinConv::Method BinConv::method() const {
8383
return Method::DIRECT_CONV;
8484
} else if (gemm_compatible()) {
8585
return Method::BGEMM;
86-
} else {
86+
} else if (input_mat->elem_c == 64) {
8787
return Method::BCONV_NAIVE;
88+
} else {
89+
return Method::BGEMM_NAIVE;
8890
}
8991
} else {
90-
if (weight_mat->c == 1) {
92+
if (input_mat->elem_c == 64) {
9193
return Method::BCONV_NAIVE;
9294
} else {
9395
return Method::BGEMM_NAIVE;
@@ -128,11 +130,11 @@ bool BinConv::gemm_compatible() const {
128130
#ifdef __aarch64__
129131
return true;
130132
#else
131-
// If weight_mat->c == 1 (weight_mat has 64 channels), we use bconv_64
133+
// If input_mat->elem_c == 1 (weight_mat has 64 channels), we use bconv_64
132134
// in aarch64 for the fastest speed, however, bconv_64 is not implemented
133135
// in armv7
134136
// TODO: Implement bconv_64 for armv7
135-
return weight_mat->c != 1;
137+
return input_mat->elem_c != 64;
136138
#endif
137139
#else
138140
return false;

0 commit comments

Comments
 (0)