import tensorflow as tf

                one_hot_spare_rep = one_hot_spare_rep * passage_mask

            one_hot_spare_rep = tf.sparse_reduce_sum(one_hot_spare_rep, axis=1) # [batch_size, extended_vsize]
            vocab_dist = tf.add(vocab_dist, one_hot_spare_rep)

            if self.options.add_first_word_prob_for_phrase:
                vocab_dist = tf.nn.softmax(vocab_dist) # normalize

        return vocab_dist # [batch_size, extended_vsize]

def linear(args, output_size, bias=True, bias_start=0.0, scope=None):
    if args is None or (isinstance(args, (list, tuple)) and not args):
