import tensorflow as tf

        vec row, should agree with vecs in shape[0]
    Output:
        A tensor of shape (vec_dim)
    """
    if reduction_mode == 'max':
        print('USING MAX POOLING FOR REDUCTION!')
        vecs_reduced = tf.segment_max(vecs, segment_inds)
    elif reduction_mode == 'mean':
        print('USING AVG POOLING FOR REDUCTION!')
        vecs_reduced = tf.segment_mean(vecs, segment_inds)
    vecs_reduced.set_shape([num_segments, vecs.get_shape()[1]])
    return vecs_reduced
