Skip to content

Commit

Permalink
[Relay, Quantization] Quantize all fields of concatenate (#2913)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinx13 authored and ZihengJiang committed Apr 1, 2019
1 parent 3746d90 commit ee95f6c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions python/tvm/relay/quantize/_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit ee95f6c

Please sign in to comment.