code: def dynamic_embedding_update(
      keys: tf.Tensor,
      values: tf.Tensor,
      config: de_config_pb2.DynamicEmbeddingConfig,
      var_name: typing.Text,
      service_address: typing.Text = "",
      timeout_ms: int = -1,
  ):
      """Updates the embeddings of given keys with given values.
  
      Args:
        keys: A string `Tensor` of shape [batch] or [batch_size,
          max_sequence_length].
        values: A `Tensor` of shape [batch_size, embedding_dimension] or
          [batch_size, max_sequence_length, embedding_dimension].
        config: A DynamicEmbeddingConfig proto that configures the embedding.
        var_name: A unique name for the given embedding.
        service_address: The address of a dynamic embedding service. If empty, the
          value passed from --kbs_address flag will be used instead.
        timeout_ms: Timeout millseconds for the connection. If negative, never
          timout.
  
      Returns:
        A `Tensor` of shape with one of below:
        - [batch_size, config.embedding_dimension] if the input Tensor is 1D, or
        - [batch_size, max_sequence_length, config.embedding_dimension] if the
          input is 2D.
      Raises:
        TypeError: If var_name is not specified.
      """
      if not var_name:
          raise TypeError("Must specify a valid var_name.")
  
      context.add_to_collection(var_name, config)
      resource = gen_carls_ops.dynamic_embedding_manager_resource(
          config.SerializeToString(),
          var_name,
          service_address,
          timeout_ms,
      )
  
      return gen_carls_ops.dynamic_embedding_update(
          keys, values, resource, config.embedding_dimension
      )
  
file_path: neural-structured-learning/research/carls/dynamic_embedding_ops.py
imports: import typing
  from research.carls import context
  from research.carls import dynamic_embedding_config_pb2
  from research.carls.kernels import gen_carls_ops
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: dynamic_embedding_update(keys, values, config, var_name, service_address, timeout_ms) and returns: gen_carls_ops