code: def testSavedModelSaveRestore(self):
      save_dir = os.path.join(self.get_temp_dir(), "save_restore")
      save_path = os.path.join(
          tempfile.mkdtemp(prefix=save_dir), "hash"
      )
  
      # TODO(b/203097231) is there an alternative that is not __internal__?
      root = tf.__internal__.tracking.AutoTrackable()
  
      default_value = -1
      root.table = simple_hash_table.SimpleHashTable(
          tf.int64, tf.int64, default_value=default_value
      )
  
      @def_function.function(
          input_signature=[tf.TensorSpec((), tf.int64)]
      )
      def lookup(key):
          return root.table.find(key)
  
      root.lookup = lookup
  
      root.table.insert(1, 100)
      root.table.insert(2, 200)
      root.table.insert(3, 300)
      self.assertEqual(root.lookup(2), 200)
      self.assertAllEqual(3, len(self.evaluate(root.table.export()[0])))
      tf.saved_model.save(root, save_path)
  
      del root
      loaded = tf.saved_model.load(save_path)
      self.assertEqual(loaded.lookup(2), 200)
      self.assertEqual(loaded.lookup(10), -1)
  
file_path: tensorflow-upstream/tensorflow/examples/custom_ops_doc/simple_hash_table/simple_hash_table_test.py
imports: import os.path
  import tempfile
  from absl.testing import parameterized
  import tensorflow
  from tensorflow.examples.custom_ops_doc.simple_hash_table import simple_hash_table
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 7 for calling the SimpleHashTableTest obj's underlying member method code with example usage: obj.testSavedModelSaveRestore() and returns: root