import tensorflow as tf

  -------
  The selected tensor.
  """
  if condition.dtype != tf.bool:
    condition = tf.cast(condition, 'bool')
  if not callable(then_expression):

    def then_expression_fn():
