code: def test_einsum_ptq_model(
      self,
      equation: str,
  ):
      (
          _,
          y_shape,
          bias_shape,
          x_signature,
          y_signature,
      ) = self._prepare_sample_einsum_datashapes(
          equation, use_bias=True
      )
  
      model = self._create_einsum_model(
          self._input_saved_model_path,
          equation,
          y_shape,
          x_signature,
          y_signature,
          bias_shape,
      )
  
      # Generate model input data.
      rng = np.random.default_rng(seed=1231)
      input_data = ops.convert_to_tensor(
          rng.uniform(low=0.0, high=1.0, size=x_signature).astype("f4")
      )
  
      def data_gen() -> repr_dataset.RepresentativeDataset:
          for _ in range(100):
              yield {
                  "x": ops.convert_to_tensor(
                      np.random.uniform(
                          low=0.0, high=1.0, size=x_signature
                      ).astype("f4")
                  ),
              }
  
      dataset_path = self.create_tempfile("tfrecord").full_path
      path_map = {"serving_default": dataset_path}
      repr_dataset.TfRecordRepresentativeDatasetSaver(path_map).save(
          {"serving_default": data_gen()}
      )
  
      config = qc.QuantizationConfig(
          static_range_ptq_preset=qc.StaticRangePtqPreset(
              representative_datasets=[
                  qc.RepresentativeDatasetConfig(
                      tf_record=qc.TfRecordFile(path=dataset_path)
                  )
              ]
          ),
          tf_saved_model=qc.TfSavedModelConfig(
              tags=[tag_constants.SERVING]
          ),
      )
      quantization.quantize_saved_model(
          self._input_saved_model_path,
          self._output_saved_model_path,
          config,
      )
  
      expected_outputs = model.einsum_with_kernel(input_data)
  
      root = load.load(self._output_saved_model_path)
      self.assertCountEqual(root.signatures.keys(), {"serving_default"})
  
      new_outputs = root.signatures["serving_default"](
          x=ops.convert_to_tensor(input_data)
      )
      # Tests that the quantized graph outputs similar values. The rtol and atol
      # values are arbitrary.
      self.assertAllClose(
          new_outputs, expected_outputs, rtol=0.02, atol=0.04
      )
  
imports: import itertools
  from typing import Optional, Sequence
  from absl.testing import parameterized
  import numpy
  from tensorflow.compiler.mlir.quantization.stablehlo import quantization_config_pb2
  from tensorflow.compiler.mlir.quantization.stablehlo.python import quantization
  from tensorflow.compiler.mlir.quantization.stablehlo.python.integration_test import quantize_model_test_base
  from tensorflow.compiler.mlir.quantization.tensorflow.python import representative_dataset
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
  from tensorflow.python.saved_model import load
  from tensorflow.python.saved_model import tag_constants
label_desc: Use image node_id 4 for calling the StaticRangeQuantizationTest obj's underlying member method code with example usage: obj.test_einsum_ptq_model(equation) without return types