Skip to content

Commit eb5d597

Browse files
Xharktensorflower-gardener
authored andcommitted
Supports custom quantizeWrapper instead of quantize annotation.
PiperOrigin-RevId: 377240567
1 parent dca2998 commit eb5d597

File tree

1 file changed

+4
-2
lines changed
  • tensorflow_model_optimization/python/core/quantization/keras

1 file changed

+4
-2
lines changed

tensorflow_model_optimization/python/core/quantization/keras/quantize.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,10 @@ def from_config(cls, config):
399399
return cls(**config)
400400

401401
def _quantize(layer): # pylint: disable=missing-docstring
402-
if (layer.name not in layer_quantize_map and
403-
layer.name not in requires_output_quantize):
402+
if ((layer.name not in layer_quantize_map and
403+
layer.name not in requires_output_quantize) or
404+
(isinstance(layer, quantize_wrapper.QuantizeWrapper))):
405+
# It supports for custom QuantizeWrapper.
404406
return layer
405407

406408
if layer.name in requires_output_quantize:

0 commit comments

Comments
 (0)