tf.keras.backend.switch

View source on GitHub

Switches between two operations depending on a scalar value.

tf.keras.backend.switch(
    condition, then_expression, else_expression
)

Note that both then_expression and else_expression should be symbolic tensors of the same shape.

Arguments:

Returns:

The selected tensor.

Raises: