Skip to content

Commit 2d5f5d7

Browse files
committed
Also guard against extremely small weights
1 parent 79f1757 commit 2d5f5d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

k_quants.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static float make_qx_quants(int n, int nmax, const float * restrict x, int8_t *
8383
float ax = fabsf(x[i]);
8484
if (ax > amax) { amax = ax; max = x[i]; }
8585
}
86-
if (!amax) { // all zero
86+
if (amax < 1e-30f) { // all zero
8787
for (int i = 0; i < n; ++i) {
8888
L[i] = 0;
8989
}

0 commit comments

Comments
 (0)