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]
  """
  if hps.att_type == "my" or hps.att_neighbor or hps.use_copy:
    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
  elif hps.att_type == "luong":
    return encoder_outputs
  else:
    assert False
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/hypernet.py