class_docstr: Test cases for TfRecordRepresentativeDatasetLoader.
class_docstr_tok: ["Test","cases","for","TfRecordRepresentativeDatasetLoader","."]
code: def test_tf_record_saver_when_signature_def_key_mismatch_raises_error(
      self,
  ):
      tf_record_path = self.create_tempfile().full_path
      representative_dataset = [{"x": [2]}]
      repr_ds_map = {"my_signature_key": representative_dataset}
  
      path_map = {"different_signature_key": tf_record_path}
      saver = repr_dataset.TfRecordRepresentativeDatasetSaver(path_map)
  
      with self.assertRaisesRegex(
          ValueError,
          (
              "SignatureDef key does not exist in the provided path_map:"
              " my_signature_key"
          ),
      ):
          saver.save(repr_ds_map)
  
imports: import random
  import numpy
  from tensorflow.compiler.mlir.quantization.tensorflow.python import representative_dataset
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import test
  from tensorflow.python.types import core
label_desc: Use image node_id 2 for calling the TfRecordRepresentativeDatasetTest obj's underlying member method code with example usage: obj.test_tf_record_saver_when_signature_def_key_mismatch_raises_error() without return types