Skip to content

Commit

Permalink
[Relay][Quantization] Fix Bug Which Cause Negative Left Shift Op (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnson9009 authored and Trevor Morris committed May 6, 2021
1 parent 7289b4e commit 6c1716d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/relay/quantize/realize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Expr QuantizeRealize(const Call& ref_call, const Array<Expr>& new_args, const Ob
MakeConstantScalar(cfg->dtype_activation, static_cast<int>(shift_nbit)));
} else {
data = LeftShift(data,
MakeConstantScalar(cfg->dtype_activation, static_cast<int>(shift_nbit)));
MakeConstantScalar(cfg->dtype_activation, static_cast<int>(-shift_nbit)));
}
data = Clip(data, clip_min_imm, clip_max_imm);
return QRealizeIntExpr(data, dom_scale, n->dtype);
Expand Down

0 comments on commit 6c1716d

Please sign in to comment.