Skip to content

Commit fe21ef7

Browse files
authored
correct counts on load
1 parent 4ad3eb2 commit fe21ef7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/imatrix/imatrix.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,10 @@ bool IMatrixCollector::load_imatrix(const char * fname) {
343343

344344
// Recreate the state as expected by save_imatrix(), and corerct for weighted sum.
345345
for (int i = 0; i < nval; i++) {
346-
e.values[i] += tmp[i];
347-
e.counts[i] += ncall;
346+
if (tmp[i]) {
347+
e.values[i] += tmp[i];
348+
e.counts[i] += ncall;
349+
}
348350
}
349351
e.ncall += ncall;
350352

0 commit comments

Comments
 (0)