[CPU] Correct crop in FQ optimized formula (#16887)

This commit is contained in:
Egor Duplenskii authored and GitHub committed 2023-04-14 10:43:05 +04:00
1 parent a7228534af
commit e98bd0dae4
1 file changed
+3
@@ -1994,6 +1994,9 @@ void FakeQuantize::updateOptimizedFormula(bool do_rounding) {
// merged with inputScale/inputShift with updated cropLow/cropHigh
clo = clo * osc + osh;
chi = chi * osc + osh;
if (clo > chi)
std::swap(clo, chi);
// crop(x*isc + ish, a, b)*osc + osh
// crop(x*isc*osc + ish*osc + osh, a', b')
isc = isc * osc;