code: def test_restore_knowledge_bank(self):
      de_ops.dynamic_embedding_update(
          ["first"],
          tf.constant([4.0, 5.0]),
          self._config,
          "emb",
          service_address=self._kbs_address,
      )
      saved_paths = io_ops.save_knowledge_bank(
          FLAGS.test_tmpdir, self._kbs_address
      )
      self.assertLen(saved_paths, 1)
  
      # Now updates the embedding value.
      de_ops.dynamic_embedding_update(
          ["first"],
          tf.constant([10.0, 20.0]),
          self._config,
          "emb",
          service_address=self._kbs_address,
      )
  
      # Checks it is updated.
      embedding = de_ops.dynamic_embedding_lookup(
          ["first"],
          self._config,
          "emb",
          service_address=self._kbs_address,
      )
      self.assertAllClose(embedding.numpy(), [[10.0, 20.0]])
  
      # Now restore the knowledge bank.
      io_ops.restore_knowledge_bank(
          self._config,
          "emb",
          saved_paths[0].numpy()[0],
          service_address=self._kbs_address,
      )
  
      # Checks it is restored.
      embedding = de_ops.dynamic_embedding_lookup(
          ["first"],
          self._config,
          "emb",
          service_address=self._kbs_address,
      )
      self.assertAllClose(embedding.numpy(), [[4.0, 5.0]])
  
file_path: neural-structured-learning/research/carls/io_ops_test.py
imports: from absl import flags
  from research.carls import context
  from research.carls import dynamic_embedding_ops
  from research.carls import io_ops
  from research.carls.testing import test_util
  import tensorflow
label_desc: Use image node_id 4 for calling the IoOpsTest obj's underlying member method code with example usage: obj.test_restore_knowledge_bank() without return types