Skip to content

Commit

Permalink
Improve error in KerasQuantizationWrapper (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chizkiyahu authored Sep 4, 2024
1 parent bd4008f commit aaee971
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mct_quantizers/keras/quantize_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ def call(self, inputs, training=None, **kwargs):
Returns: tensors that simulate a quantized layer.
"""
if training is not None and not isinstance(training, bool):
Logger.critical(f"Argument type mismatch: expected 'training' argument to be of type 'boolean' "
f"but got {type(training)}")

if training is None:
training = tf.keras.backend.learning_phase()

Expand Down

0 comments on commit aaee971

Please sign in to comment.