from tensorflow.python.ops import variable_scope

            if options.use_coverage:
                with variable_scope.variable_scope("coverage"):
                    w_c = variable_scope.get_variable("w_c", [options.attention_vec_size])
                    w_c = tf.expand_dims(tf.expand_dims(w_c, axis=0), axis=0)

            # For each step, dec_input => lstm_output => vocab_score
            wordidx_t = decoder_inputs[0] # [batch_size] int32
            for i in range(options.max_answer_len):
                if mode_gen in ('ce_train', 'loss',): wordidx_t = decoder_inputs[i] # the wordidx_t must from decoder_inputs for phrase model
                word_t = self.embedding_lookup(wordidx_t)
                if i > 0:
                    variable_scope.get_variable_scope().reuse_variables()

                (state_t, context_t, coverage_t, attn_dist_t, p_gen_t, output_t) = self.one_step_decoder(
                                state_t_1, context_t_1, coverage_t_1, word_t, encoder_states, self.encoder_features,
                                passage_word_idx, passage_mask, v, w_c, vocab)
                coverages.append(coverage_t)
                attn_dists.append(attn_dist_t)
                p_gens.append(p_gen_t)
                vocab_scores.append(output_t) # The vocabulary distributions.

                state_t_1 = state_t
