Skip to content

Commit c1fad30

Browse files
vinx13ajtulloch
authored andcommitted
[Relay, Quantization] Quantize all fields of concatenate (apache#2913)
1 parent e223b3e commit c1fad30

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

python/tvm/relay/quantize/_annotate.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,10 @@ def concatenate_rewrite(ref_call, new_args, ctx):
253253

254254
# make sure the inputs of concatenate are all normal
255255
# expression or annotate expression
256-
if kind_list[0] is None:
257-
for k in kind_list:
258-
assert k is None
256+
if all([k is None for k in kind_list]):
259257
return None
260-
for k in kind_list:
261-
assert k is not None
258+
for i, k in enumerate(kind_list):
259+
if k is None:
260+
expr_list[i] = attach_simulated_quantize(expr_list[i], QAnnotateKind.ACTIVATION)
262261
expr = _forward_op(ref_call, [_expr.Tuple(expr_list)])
263262
return QAnnotateExpr(expr, QAnnotateKind.ACTIVATION)

0 commit comments

Comments
 (0)