Skip to content

Commit

Permalink
[Backport-0.7][Quantize] Fix Bug Which Cause Negative Left Shift Op (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnson9009 committed Feb 17, 2021
1 parent cdb00da commit 56000bb
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 56000bb

Please sign in to comment.