tf.keras.backend.in_test_phase

View source on GitHub

Selects x in test phase, and alt otherwise.

tf.keras.backend.in_test_phase(
    x, alt, training=None
)

Note that alt should have the same shape as x.

Arguments:

Returns:

Either x or alt based on K.learning_phase.