code: def _run_function_for_calibration_graph_mode(
      sess: session.Session,
      signature_def: meta_graph_pb2.SignatureDef,
      representative_dataset: rd.RepresentativeDataset,
  ) -> None:
      """Runs the representative dataset through a function for calibration.
  
      NOTE: This is intended to be run in graph mode (TF1).
  
      The function is identified by the SignatureDef.
  
      Args:
        sess: The Session object to run the function in.
        signature_def: A SignatureDef that identifies a function by specifying the
          inputs and outputs.
        representative_dataset: The representative dataset to run through the
          function.
      """
      output_tensor_names = [
          output_tensor_info.name
          for output_tensor_info in signature_def.outputs.values()
      ]
  
      sample_validator = _create_sample_validator(
          expected_input_keys=signature_def.inputs.keys()
      )
  
      for sample in map(
          sample_validator,
          _log_sample_num_for_calibration(representative_dataset),
      ):
          # Create a mapping from input tensor name to the input tensor value.
          # ex) "Placeholder:0" -> [0, 1, 2]
          feed_dict = rd.create_feed_dict_from_input_data(
              sample, signature_def
          )
          sess.run(output_tensor_names, feed_dict=feed_dict)
  
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 7 for calling a global function with example usage: _run_function_for_calibration_graph_mode(sess, signature_def, representative_dataset) without return types