Dropout except test.

def dropout(tensor, drop_prob, is_training):
    '''
    Dropout except test.
    '''
    if not is_training:
        return tensor
    return tf.nn.dropout(tensor, 1.0 - drop_prob)