def compute_summary_embedding(input_embeddings, input_lengths, hparams):
  """Convert list of embedding to single embedding.

  Args:
    input_embeddings: <tf.float32>[bs, max_seq_len, emb_dim]
    input_lengths: <tf.int64>[bs, 1]
    hparams: model hparams

  Returns:
    embedding: <tf.float32>[bs, emb_dim]
  """
  if hparams.pool_technique == "average":
    return compute_average_embedding(input_embeddings, input_lengths)
  elif hparams.pool_technique == "max_pool":
    return compute_max_pool_embedding(input_embeddings, input_lengths)
  elif hparams.pool_technique == "last":
    return compute_last_embedding(input_embeddings, input_lengths, hparams)
Convert list of embedding to single embedding.

  Args:
    input_embeddings: <tf.float32>[bs, max_seq_len, emb_dim]
    input_lengths: <tf.int64>[bs, 1]
    hparams: model hparams

  Returns:
    embedding: <tf.float32>[bs, emb_dim]
  
tensor2tensor/models/neural_assistant.py