From ee95f6c8f2ecf5c7f772d343ee1d54418e73a1e4 Mon Sep 17 00:00:00 2001 From: Wuwei Lin Date: Tue, 2 Apr 2019 06:57:56 +0800 Subject: [PATCH] [Relay, Quantization] Quantize all fields of concatenate (#2913) --- python/tvm/relay/quantize/_annotate.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/tvm/relay/quantize/_annotate.py b/python/tvm/relay/quantize/_annotate.py index 08d56a3ca23f..40ea99ae6b6e 100644 --- a/python/tvm/relay/quantize/_annotate.py +++ b/python/tvm/relay/quantize/_annotate.py @@ -253,11 +253,10 @@ def concatenate_rewrite(ref_call, new_args, ctx): # make sure the inputs of concatenate are all normal # expression or annotate expression - if kind_list[0] is None: - for k in kind_list: - assert k is None + if all([k is None for k in kind_list]): return None - for k in kind_list: - assert k is not None + for i, k in enumerate(kind_list): + if k is None: + expr_list[i] = attach_simulated_quantize(expr_list[i], QAnnotateKind.ACTIVATION) expr = _forward_op(ref_call, [_expr.Tuple(expr_list)]) return QAnnotateExpr(expr, QAnnotateKind.ACTIVATION)