code: def _replace_tensors_by_numpy_ndarrays(
      repr_ds_map: rd.RepresentativeDatasetMapping,
  ) -> None:
      """Replaces tf.Tensors by their evaluated numpy arrays.
  
      This assumes that tf.Tensors in representative samples are created in the
      default Graph. It will raise an error if tensors are created in a different
      graph.
  
      Args:
        repr_ds_map: SignatureDef key -> RepresentativeDataset mapping.
      """
      with session.Session() as sess:
          for signature_def_key in repr_ds_map:
              # Replaces the dataset with a new dataset where tf.Tensors are replaced
              # by their evaluated values.
              ds = repr_ds_map[signature_def_key]
              repr_ds_map[
                  signature_def_key
              ] = rd.replace_tensors_by_numpy_ndarrays(ds, sess)
  
imports: from collections.abc import Callable, Collection, Mapping, Sequence
  from typing import Optional
  from absl import logging
  from tensorflow.compiler.mlir.quantization.tensorflow import exported_model_pb2
  from tensorflow.compiler.mlir.quantization.tensorflow import quantization_options_pb2
  from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_algorithm
  from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import calibration_statistics_pb2
  from tensorflow.compiler.mlir.quantization.tensorflow.calibrator import pywrap_calibration
  from tensorflow.compiler.mlir.quantization.tensorflow.python import pywrap_function_lib
  from tensorflow.compiler.mlir.quantization.tensorflow.python import representative_dataset
  from tensorflow.compiler.mlir.quantization.tensorflow.python import save_model
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.client import session
  from tensorflow.python.eager import context
  from tensorflow.python.eager import wrap_function
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_conversion
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.saved_model import load
  from tensorflow.python.saved_model import loader_impl
  from tensorflow.python.trackable import autotrackable
  from tensorflow.python.types import core
label_desc: Use image node_id 4 for calling a global function with example usage: _replace_tensors_by_numpy_ndarrays(repr_ds_map) without return types