code: def dynamic_embedding_lookup(
      keys: tf.Tensor,
      config: de_config_pb2.DynamicEmbeddingConfig,
      var_name: typing.Text,
      service_address: typing.Text = "",
      skip_gradient_update: bool = False,
      timeout_ms: int = -1,
  ) -> tf.Tensor:
      """Returns the embeddings of from given keys.
  
      Args:
        keys: A string `Tensor` of shape [batch_size] or [batch_size,
          max_sequence_length] where an empty string would be mapped to an all zero
          embedding.
        config: A DynamicEmbeddingConfig proto that configures the embedding.
        var_name: A unique name for the given embedding.
        service_address: The address of a knowledge bank service. If empty, the
          value passed from --kbs_address flag will be used instead.
        skip_gradient_update: A boolean indicating if gradient update is needed.
        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:
        ValueError: If name is not specified.
      """
      if not var_name:
          raise ValueError("Must specify a valid var_name.")
  
      # If skip_gradient_update is true, reate a dummy variable so that the
      # gradients can be passed in.
      if skip_gradient_update:
          grad_placeholder = tf.constant(0.0)
      else:
          grad_placeholder = tf.Variable(0.0)
  
      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_lookup(
          keys, grad_placeholder, 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 1 for calling a global function with example usage: dynamic_embedding_lookup(keys, config, var_name, service_address, skip_gradient_update, timeout_ms) and returns: gen_carls_ops