def _build_context(hps, encoder_outputs):
  """Compute feature representations for attention/copy.

  Args:
    hps: hyperparameters.
    encoder_outputs: outputs by the encoder RNN.

  Returns:
    Feature representation of [batch_size, seq_len, decoder_dim]
  """
  with tf.variable_scope("memory_context"):
    context = tf.layers.dense(
        encoder_outputs,
        units=hps.decoder_dim,
        activation=None,
        use_bias=False,
        kernel_initializer=tf.contrib.layers.xavier_initializer(),
        name="memory_projector")
  return context
Compute feature representations for attention/copy.

  Args:
    hps: hyperparameters.
    encoder_outputs: outputs by the encoder RNN.

  Returns:
    Feature representation of [batch_size, seq_len, decoder_dim]
  
language/labs/exemplar_decoding/models/baselines.py