code: def _swap_where(condition, x, y):
      """Swaps the elements of `x` and `y` based on `condition`.
  
      Args:
        condition: A `Tensor` of dtype bool.
        x: A `Tensor` with the same shape as `condition`.
        y: A `Tensor` with the same shape and dtype as `x`.
  
      Returns:
        Two `Tensors` with the same shape as `x` and `y`.
      """
      return tf.where(condition, y, x), tf.where(condition, x, y)
  
file_path: tf-quant-finance/tf_quant_finance/math/root_search/brent.py
imports: from typing import Callable
  import tensorflow.compat.v2
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.math.root_search import utils
label_desc: Use image node_id 1 for calling a global function with example usage: _swap_where(condition, x, y) and returns: tf,  tf