import tensorflow as tf

        w_c: [1,1, attention_vec_size]
        coverage: [batch_size, passage_len]
        '''
        with variable_scope.variable_scope("Attention"):
            # Equation (11) in the paper
            state_features = linear(decoder_state, attention_vec_size, True) # [batch_size, attention_vec_size]
            state_features = tf.expand_dims(state_features, 1) # [batch_size, 1, attention_vec_size]
            all_features = encoder_features + state_features # [batch_size,passage_len,attention_vec_size]
            if use_coverage and coverage is not None:
                coverage_features = tf.expand_dims(coverage, axis=-1) * w_c # [batch_size, passage_len, attention_vec_size]
                all_features += coverage_features
            e = tf.reduce_sum(v * tf.tanh(all_features), axis=-1) # [batch_size, passage_len]
