Skip to content

Commit

Permalink
Update quantize_layer.py
Browse files Browse the repository at this point in the history
Calling super.build() of the layer to indicate that the layer was built.
Previous version did not set the self.built=True flag and would lead to a mismatch between stored and expected weights when loading a .keras model
  • Loading branch information
MaierOli2010 authored Mar 8, 2024
1 parent 92e8ab0 commit 0ada0a0
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(self, quantizer, **kwargs):
self.quantizer = quantizer

def build(self, input_shape):
super(QuantizeLayer, self).build(input_shape)
if self.quantizer:
self.quantizer_vars = self.quantizer.build(
input_shape, self.name, self)
Expand Down

0 comments on commit 0ada0a0

Please sign in to comment.