int8 quantization fails with "Aborted (core dumped)" because real_output_multiplier > 1 in tensorflow/lite/kernels/add.cc
Hi @akrapukhin, go ahead and make the PR stating that it fixes this issue. We will review internally and if we need a more general solution it will likely be part of the review (or of course if you figure it out feel free to update the PR). We appreciate your contribution! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. > 

Ok, will make a PR then, thanks This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60815">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/60815">No</a>

### 1. System information

- OS Platform and Distribution: Linux Ubuntu 20.04:
- TensorFlow installation: pip package
- TensorFlow library: v2.12.0

### 2. Problem
When I quantize my model in int8 format it fails with "Aborted (core dumped)". The quantization code is pretty standard:
```
model = some_model()
converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.representative_dataset = some_repr_dataset()
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
converter.inference_input_type = tf.int8
converter.inference_output_type = tf.int8
```

Unfortunately, I cannot provide this model. However, I was able to find the exact reason why it fails. My model has some add operations with real_output_multiplier larger than one (see https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/add.cc#L197). 
When QuantizeMultiplierSmallerThanOneExp is called with this real_output_multiplier, it hits TFLITE_CHECK_LT (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/kernels/internal/quantization_util.cc#L117) and calls TFLITE_ABORT without printing any useful info.

Here is a patch which fixes the problem, and my model is successfully quantized:

```
diff --git a/tensorflow/lite/kernels/add.cc b/tensorflow/lite/kernels/add.cc
index 6cad1883750..ebe71222f7c 100644
--- a/tensorflow/lite/kernels/add.cc
+++ b/tensorflow/lite/kernels/add.cc
@@ -189,8 +189,14 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
     QuantizeMultiplierSmallerThanOneExp(
         real_input2_multiplier, &data->input2_multiplier, &data->input2_shift);
 
-    QuantizeMultiplierSmallerThanOneExp(
-        real_output_multiplier, &data->output_multiplier, &data->output_shift);
+    if (real_output_multiplier > 1){
+      QuantizeMultiplierGreaterThanOne(
+          real_output_multiplier, &data->output_multiplier, &data->output_shift);
+    }
+    else {
+      QuantizeMultiplierSmallerThanOneExp(
+          real_output_multiplier, &data->output_multiplier, &data->output_shift);
+    }
 
     TF_LITE_ENSURE_STATUS(CalculateActivationRangeQuantized(
         context, params->activation, output, &data->output_activation_min,
```

It seems that some operations were fixed to work with multiplier > 1 (see https://github.com/tensorflow/tensorflow/issues/20451).
I could make a pull request, but I'm not sure that my solution is universal enough. It's also not clear to me how it should behave if real_output_multiplier == 1.
