diff options
Diffstat (limited to 'chapters/introduction.adoc')
-rw-r--r-- | chapters/introduction.adoc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chapters/introduction.adoc b/chapters/introduction.adoc index c34bf7b..c6764d3 100644 --- a/chapters/introduction.adoc +++ b/chapters/introduction.adoc @@ -397,7 +397,7 @@ if (!local_bound) { output_bnd = operation_fp64(input_abs, weight_abs, bias_abs); size_t T = tensor_size(output_shape) // number dot product results -size_t ksb = (max_value(bias_abs) > 0) ? (KS + 1) : KS; // kernel size and bias +size ksb = ceil(KS / exp2(normal_frac<acc_t>() - normal_frac<out_t>())) + ((max_value(bias_abs) > 0) ? 1 : 0); fp64_t out_err_sum = 0.0; fp64_t out_err_sumsq = 0.0; for_each(index in output_shape) { @@ -412,7 +412,7 @@ for_each(index in output_shape) { REQUIRE(out_ref == 0.0 && out_imp == 0.0); out_err = 0.0; } else { // 0.0 < out_bnd < infinity - fp64_t out_err_bnd = max(out_bnd * exp2(-1-normal_frac<acc_t>()), normal_min<acc_t>()); + fp64_t out_err_bnd = max(out_bnd * exp2(-1-normal_frac<out_t>()), normal_min<out_t>()); out_err = (static_cast<fp64_t>(out_imp) - out_ref) / out_err_bnd; REQUIRE(abs(out_err) <= ksb); } |