def in_train_phase(x, alt):
    x_shape = copy.copy(x.get_shape())
    x = tf.python.control_flow_ops.cond(tf.cast(_LEARNING_PHASE, 'bool'),
                                        lambda: x,
                                        lambda: alt)
    x._uses_learning_phase = True
    x.set_shape(x_shape)
    return x
Selects `x` in train phase, and `alt` otherwise.
dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py/in_train_phase