Skip to content

Commit e538361

Browse files
Xharktensorflower-gardener
authored andcommitted
Add relu6 supports.
PiperOrigin-RevId: 447585136
1 parent d2ecffc commit e538361

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tensorflow_model_optimization/python/core/quantization/keras/default_8bit/default_8bit_quantize_registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ def get_output_quantizers(self, layer):
502502
'Default8BitActivationQuantizeConfig.'.format(
503503
layer.activation))
504504

505-
if layer.activation.__name__ in ['relu', 'swish', 'gelu']:
505+
if layer.activation.__name__ in ['relu', 'swish', 'gelu', 'relu6']:
506506
# 'relu' should generally get fused into the previous layer.
507507
return [quantizers.MovingAverageQuantizer(
508508
num_bits=8, per_axis=False, symmetric=False, narrow_range=False)]

0 commit comments

Comments
 (0)