Commit df722397 by Wuwei Lin Committed by Tianqi Chen

[Relay][Quantization] Fix duplicated simulated quantization (#2803)

parent 5f89a50e
......@@ -112,6 +112,11 @@ def attach_simulated_quantize(data, kind, sign=True, rounding="round"):
kind: QAnnotateKind
the kind of annotation field.
"""
quantize_op = _op.get("relay.op.annotation.simulated_quantize")
if isinstance(data, _expr.Call) and data.op == quantize_op:
if data.attrs.kind == kind and data.attrs.sign == sign and data.attrs.rounding == rounding:
return data
dom_scale = _expr.var("dom_scale")
clip_min = _expr.var("clip_min")
clip_max = _expr.var("clip_max")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment