import tensorflow as tf

            if coverage is not None: # Update coverage vector
                coverage += attn_dist
            else: # first step of training
                coverage = attn_dist

            # Calculate the context vector from attn_dist and encoder_states
            # shape (batch_size, attn_size).
            context_vector = tf.reduce_sum(tf.expand_dims(attn_dist, axis=-1) * encoder_states, axis=1) # [batch_size, encoder_dim]
        return context_vector, attn_dist, coverage

    def embedding_lookup(self, inputs):
        '''
        inputs: list of [batch_size], int32
        '''
