diff --git a/python/tvm/relay/quantize/quantize.py b/python/tvm/relay/quantize/quantize.py index ff11eddcda8a0..8a8c82c7e6d69 100644 --- a/python/tvm/relay/quantize/quantize.py +++ b/python/tvm/relay/quantize/quantize.py @@ -374,10 +374,9 @@ def quantize(mod, params=None, dataset=None): q_cfg = current_qconfig() assert q_cfg.partition_conversions in ['disabled', 'enabled', 'fully_integral'] - if q_cfg.partition_conversions == 'disabled': - return mod - else: + if q_cfg.partition_conversions != 'disabled': quantized_dtypes = {q_cfg.dtype_input, q_cfg.dtype_weight, q_cfg.dtype_activation} ensure_fully_integral = q_cfg.partition_conversions == 'fully_integral' return partition_conversions(mod, quantized_dtypes, ensure_fully_integral) + return mod