(self, inputs)
return outputs, out_state, attn_dists, p_gens, coverage
Add attention decoder to the graph. In train or eval mode, you call this once to get output on ALL steps. In decode (beam search) mode, you call this once for EACH decoder step.

    Args:
      inputs: inputs to the decoder (word embeddings). A list of tensors shape (batch_size, emb_dim)

    Returns:
      outputs: List of tensors; the outputs of the decoder
      out_state: The final state of the decoder
      attn_dists: A list of tensors; the attention distributions
      p_gens: A list of tensors shape (batch_size, 1); the generation probabilities
      coverage: A tensor, the current coverage vector
Add attention decoder to the graph. In train or eval mode, you call this once to get output on ALL steps. In decode (beam search) mode, you call this once for EACH decoder step.
Add attention decoder to the graph . In train or eval mode you call this once to get output on ALL steps . In decode ( beam search ) mode you call this once for EACH decoder step .
def _add_decoder(self, inputs):
    """Add attention decoder to the graph. In train or eval mode, you call this once to get output on ALL steps. In decode (beam search) mode, you call this once for EACH decoder step.

    Args:
      inputs: inputs to the decoder (word embeddings). A list of tensors shape (batch_size, emb_dim)

    Returns:
      outputs: List of tensors; the outputs of the decoder
      out_state: The final state of the decoder
      attn_dists: A list of tensors; the attention distributions
      p_gens: A list of tensors shape (batch_size, 1); the generation probabilities
      coverage: A tensor, the current coverage vector
    """
    hps = self._hps
    cell = tf.contrib.rnn.LSTMCell(hps.hidden_dim, state_is_tuple=True, initializer=self.rand_unif_init)

    prev_coverage = self.prev_coverage if hps.mode=="decode" and hps.coverage else None # In decode mode, we run attention_decoder one step at a time and so need to pass in the previous step's coverage vector each time

    outputs, out_state, attn_dists, p_gens, coverage = attention_decoder(inputs, self._dec_in_state, self._enc_states, self._enc_padding_mask, cell, initial_state_attention=(hps.mode=="decode"), pointer_gen=hps.pointer_gen, use_coverage=hps.coverage, prev_coverage=prev_coverage)

    return outputs, out_state, attn_dists, p_gens, coverage
def _add_decoder ( self , inputs ) : hps = self . _hps cell = tf . contrib . rnn . LSTMCell ( hps . hidden_dim , state_is_tuple = True , initializer = self . rand_unif_init ) prev_coverage = self . prev_coverage if hps . mode == "decode" and hps . coverage else None # In decode mode, we run attention_decoder one step at a time and so need to pass in the previous step's coverage vector each time outputs , out_state , attn_dists , p_gens , coverage = attention_decoder ( inputs , self . _dec_in_state , self . _enc_states , self . _enc_padding_mask , cell , initial_state_attention = ( hps . mode == "decode" ) , pointer_gen = hps . pointer_gen , use_coverage = hps . coverage , prev_coverage = prev_coverage ) return outputs , out_state , attn_dists , p_gens , coverage