Skip to content

Commit

Permalink
workaround: allow synthesis model with empty layers
Browse files Browse the repository at this point in the history
  • Loading branch information
calad0i committed Feb 21, 2024
1 parent 94861c1 commit af68896
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/HGQ/proxy/fixed_point_quantizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ def heterogeneous(self):

def get_config(self):
assert tf.reduce_all((self.keep_negative == 0) | (self.keep_negative == 1)), 'Illegal bitwidth config: keep_negative must be 0 or 1.'
assert tf.reduce_all(self.bits >= 0), 'Illegal bitwidth config: bits must be non-negative.' # type:ignore
if not tf.reduce_all(self.bits >= 0): # type:ignore
warn('Illegal bitwidth config: bits must be non-negative.')
self.bits.assign(tf.maximum(self.bits, 0))
conf = super().get_config()
conf['RND'] = self.RND
conf['SAT'] = self.SAT
Expand Down

0 comments on commit af68896

Please sign in to comment.