code: def testUpdate_2DInput(self, skip_gradient):
      init = self._config.knowledge_bank_config.initializer
      init.default_embedding.value.append(1)
      init.default_embedding.value.append(2)
      embedding = de_ops.dynamic_embedding_lookup(
          [["first", "second"], ["third", ""]],
          self._config,
          "emb",
          service_address=self._kbs_address,
          skip_gradient_update=skip_gradient,
      )
      self.assertAllClose(
          embedding.numpy(), [[[1, 2], [1, 2]], [[1, 2], [0, 0]]]
      )
  
      # The values for an empty key should be ignored.
      update_res = de_ops.dynamic_embedding_update(
          [["first", "second"], ["third", ""]],
          tf.constant(
              [[[2.0, 4.0], [4.0, 8.0]], [[8.0, 16.0], [16.0, 32.0]]]
          ),
          self._config,
          "emb",
          service_address=self._kbs_address,
      )
      self.assertAllClose(
          update_res.numpy(), [[[2, 4], [4, 8]], [[8, 16], [0, 0]]]
      )
  
      embedding = de_ops.dynamic_embedding_lookup(
          [["first", "second"], ["third", ""]],
          self._config,
          "emb",
          service_address=self._kbs_address,
          skip_gradient_update=skip_gradient,
      )
      self.assertAllClose(
          embedding.numpy(), [[[2, 4], [4, 8]], [[8, 16], [0, 0]]]
      )
  
      # Allows keys' shape to be [N1, N2, 1] and values shape to be [N1, N2, D].
      update_res = de_ops.dynamic_embedding_update(
          [[["first"], ["second"]], [["third"], [""]]],
          tf.constant(
              [[[3.0, 5.0], [5.0, 9.0]], [[9.0, 17.0], [17.0, 33.0]]]
          ),
          self._config,
          "emb",
          service_address=self._kbs_address,
      )
      self.assertAllClose(
          update_res.numpy(), [[[3, 5], [5, 9]], [[9, 17], [0, 0]]]
      )
      embedding = de_ops.dynamic_embedding_lookup(
          [["first", "second"], ["third", ""]],
          self._config,
          "emb",
          service_address=self._kbs_address,
          skip_gradient_update=skip_gradient,
      )
      self.assertAllClose(
          embedding.numpy(), [[[3, 5], [5, 9]], [[9, 17], [0, 0]]]
      )
  
imports: import itertools
  from absl.testing import parameterized
  from research.carls import context
  from research.carls import dynamic_embedding_ops
  from research.carls.testing import test_util
  import numpy
  import tensorflow
label_desc: Use image node_id 6 for calling the DynamicEmbeddingOpsTest obj's underlying member method code with example usage: obj.testUpdate_2DInput(skip_gradient) without return types