Skip to content

Commit

Permalink
fix fused_qbias rnd bw corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
calad0i committed Nov 29, 2023
1 parent 2ef7b71 commit 8e95f8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/HGQ/layers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def fused_qbias(self):
mask = tf.reduce_max(self.act_bw, axis=dims, keepdims=False) > 0

if self.paq.rnd_strategy != 3 and self.can_bias_cover_rnd:
bias = tf.pow(2., -tf.floor(fbw + 0.5) - 1) + bias # type: ignore
bias = tf.pow(2., -tf.round(fbw) - 1) + bias # type: ignore

return tf.where(mask, bias, 0.)

Expand Down

0 comments on commit 8e95f8b

Please sign in to comment.