Add support for quantization when real_output_multiplier >= 1 in lite/kernels/add.cc
Hi @akrapukhin Can you please resolve conflicts? Thank you! I resolved the conflicts Hi @LukeBoyer Any update on this PR? Please. Thank you! Hi @akrapukhin Can you please resolve conflicts? Thank you! ack, I will take a look. Need to understand whats happening a bit better. Hi @akrapukhin Can you please resolve conflicts? Thank you! This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you. resolved Hi @LukeBoyer Can you please review this PR ? Thank you! Hi @LukeBoyer Can you please review this PR ? Thank you! Hi @LukeBoyer Can you please review this PR ? Thank you! Hi @LukeBoyer Can you please review this PR ? Thank you!
This PR fixes #60815

Notes:
1) the problem and the fix are similar to https://github.com/tensorflow/tensorflow/blob/master/tensorflow/security/advisory/tfsa-2022-081.md where lite/kernels/comparisons.cc is fixed.
2) It's not clear what to do when a multiplier is equal to one. I think that this case should be covered by QuantizeMultiplierGreaterThanOne, because in this case it works as a multiplication by 0.5 followed by a left shift by 1. But to enable it I had to change TFLITE_CHECK_GT to TFLITE_CHECK_GE in tensorflow/lite/kernels/internal/quantization_util.cc, and now this check doesn't match the name of the function (QuantizeMultiplierGreaterThanOne). Ideally there should be no multiplication at all of course, but I don't know how to implement it correctly. Maybe it's just not worth the effort considering that the probability of a multiplier == 1 seems to be very low.
3) I think that the same problem might exist in two other kernels:
lite/kernels/squared_difference.cc
lite/kernels/sub.cc
4) I changed x * (1 << left_shift) to SaturatingRoundingMultiplyByPOTParam(x, left_shift) because I ran into overflow issues when testing real_output_multiplier > 1 with int16 numbers.
