def _build_rnn_cell(self, embeddings, sequences, sequences_length,
                      mode, hparams):
    """Builds attentive RNN cell for decoding."""
    # Build RNN cell.
    rnn_cell = super(AttentiveRNNDecoder, self)._build_rnn_cell(
        embeddings=embeddings,
        sequences=sequences,
        sequences_length=sequences_length,
        mode=mode,
        hparams=hparams)

    # Wrap cell with attention over the target embedding vocabulary.
    memory = tf.expand_dims(embeddings, 0)
    rnn_cell = self._wrap_with_attention(
        cell=rnn_cell,
        memory=memory,
        hparams=hparams)

    return rnn_cell
Builds attentive RNN cell for decoding.
language/labs/consistent_zero_shot_nmt/modules/decoders.py