Quantized TFLite fails to load after conversion.
Hi @basnetr,

I have reproduced the code with tensorflow latest version 2.15. All the 3 models are working fine. Please update tensorflow to 2.15. Refer the [gist.](https://colab.research.google.com/gist/LakshmiKalaKadali/3f6ef5cc570c0c4276a945f815c82f63/tflite_62737.ipynb)

Thank You 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/62737">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/62737">No</a>

### 1. System information

- OS Platform and Distribution: Linux Ubuntu 20.04.5 LTS
- TensorFlow installation: pip package
- TensorFlow library: 2.8.4

### 2. Code
Code to reproduce issue:
```
import numpy as np  # 1.26.2
import tensorflow as tf  # 2.8.4
from tensorflow import keras  # 2.8.0
from pathlib import Path


class ImplicitA(keras.layers.Layer):
    def __init__(self, mean, std, name, **kwargs):
        super(ImplicitA, self).__init__(name=name, **kwargs)
        self.mean = mean
        self.std = std

    def build(self, input_shape):
        self.impa = self.add_weight(
            name=self.name,
            shape=(1, 1, 1, input_shape[-1]),
            initializer=keras.initializers.RandomNormal(
                mean=self.mean, stddev=self.std
            ),
            trainable=True
        )

    def call(self, x):
        return tf.cast(x, self.impa.dtype) + self.impa

    def get_config(self):
        config = super(ImplicitA, self).get_config()
        config.update(
            {'mean': self.mean, 'std': self.std}
        )
        return config


class ImplicitM(keras.layers.Layer):
    def __init__(self, mean, std, name, **kwargs):
        super(ImplicitM, self).__init__(name=name, **kwargs)
        self.mean = mean
        self.std = std

    def build(self, input_shape):
        self.impm = self.add_weight(
            name=self.name,
            shape=(1, 1, 1, input_shape[-1]),
            initializer=keras.initializers.RandomNormal(
                mean=self.mean, stddev=self.std
            ),
            trainable=True
        )

    def call(self, x):
        return tf.cast(x, self.impm.dtype) * self.impm

    def get_config(self):
        config = super(ImplicitM, self).get_config()
        config.update(
            {'mean': self.mean, 'std': self.std}
        )
        return config


def model1():
    inputs = keras.Input(shape=(32, 32, 4))
    x = ImplicitA(mean=0.0, std=0.02, name='impa')(inputs)
    x = keras.layers.Conv2D(
        filters=8, kernel_size=1, strides=1, name='conv'
    )(x)
    x = ImplicitM(mean=0.0, std=0.02, name='impm')(x)
    return keras.Model(inputs=inputs, outputs=x)


def model2():
    inputs = keras.Input(shape=(32, 32, 4))
    x = ImplicitA(mean=0.0, std=0.02, name='impa')(inputs)
    x = keras.layers.Conv2D(
        filters=8, kernel_size=1, strides=1, name='conv'
    )(x)
    return keras.Model(inputs=inputs, outputs=x)


def model3():
    inputs = keras.Input(shape=(32, 32, 4))
    x = ImplicitA(mean=0.0, std=0.02, name='impa')(inputs)
    x = ImplicitM(mean=0.0, std=0.02, name='impm')(x)
    x = keras.layers.Conv2D(
        filters=8, kernel_size=1, strides=1, name='conv'
    )(x)
    return keras.Model(inputs=inputs, outputs=x)


if __name__ == "__main__":
    model = model1()
    model.summary()
    model_path = str(Path(__file__).parent / "temp_model.h5")
    model.save(model_path)

    # load model
    model = keras.models.load_model(
        model_path,
        custom_objects={
            "ImplicitA": ImplicitA,
            "ImplicitM": ImplicitM
        }
    )

    # convert to tflite
    in_sh = model.input.shape

    def datagen():
        yield [np.ones((1, in_sh[1], in_sh[2], in_sh[3])).astype(np.float32)]

    converter = tf.lite.TFLiteConverter.from_keras_model(model)
    converter.representative_dataset = datagen
    converter.optimizations = [tf.lite.Optimize.DEFAULT]
    converter.inference_input_type = tf.int8
    converter.inference_output_type = tf.int8
    converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]

    tflite_model = converter.convert()

    tflite_model_path = str(Path(__file__).parent / "temp_model.tflite")
    with open(tflite_model_path, 'wb') as f:
        f.write(tflite_model)

    interpreter = tf.lite.Interpreter(model_path=tflite_model_path)


```



### 3. Failure after conversion
Conversion is successful but error while loading the converted model using:
`interpreter = tf.lite.Interpreter(model_path=tflite_model_path)`

Note: `model2()` and `model3()` work fine but issue with `model1()`

### 4. Logs
```
Traceback (most recent call last):
  File "/home/ubuntu/replicate_quantization_error.py", line 124, in <module>
    interpreter = tf.lite.Interpreter(model_path=tflite_model_path)
  File "/home/ubuntu/miniconda3/envs/automl/lib/python3.9/site-packages/tensorflow/lite/python/interpreter.py", line 456, in __init__
    _interpreter_wrapper.CreateWrapperFromFile(
ValueError: num_scales must be 1 for per-layer quantization, or 1 for per-axis quantization, but got 8.Tensor 3 has invalid quantization parameters.

```
