class_docstr: Implements the TF backend ops for a PC auto-batching VM.
docstr: Implements a where selector for the TF backend.
  
  Attempts to match the dtypes of the value operands, if they are not yet both
  `Tensor`s.
  
  Args:
    condition: A boolean `Tensor`, either a vector having length
      `(x + y).shape[0]` or matching the full shape of `x + y`.
    x: `Tensor` of values to take when `condition` is `True`. Shape must match
      that of `y`.
    y: `Tensor` of values to take when `condition` is `False`. Shape must
      match that of `x`.
    name: Optional name for the op.
  
  Returns:
    masked: A broadcast-shaped `Tensor` where elements corresponding to `True`
      values of `condition` come from `x`, and others come from `y`.
docstr_tok: ["Implements","a","where","selector","for","the","TF","backend",".","Attempts","to","match","the","dtypes","of","the","value","operands",",","if","they","are","not","yet","both","`","Tensor","`","s",".","Args",":","condition",":","A","boolean","`","Tensor","`",",","either","a","vector","having","length","`","(","x","+","y",")",".shape","[","0","]","`","or","matching","the","full","shape","of","`","x","+","y","`",".","x",":","`","Tensor","`","of","values","to","take","when","`","condition","`","is","`","True","`",".","Shape","must","match","that","of","`","y","`",".","y",":","`","Tensor","`","of","values","to","take","when","`","condition","`","is","`","False","`",".","Shape","must","match","that","of","`","x","`",".","name",":","Optional","name","for","the","op",".","Returns",":","masked",":","A","broadcast-shaped","`","Tensor","`","where","elements","corresponding","to","`","True","`","values","of","`","condition","`","come","from","`","x","`",",","and","others","come","from","`","y","`","."]
code: def where(self, condition, x, y, name=None):
      """Implements a where selector for the TF backend.
  
      Attempts to match the dtypes of the value operands, if they are not yet both
      `Tensor`s.
  
      Args:
        condition: A boolean `Tensor`, either a vector having length
          `(x + y).shape[0]` or matching the full shape of `x + y`.
        x: `Tensor` of values to take when `condition` is `True`. Shape must match
          that of `y`.
        y: `Tensor` of values to take when `condition` is `False`. Shape must
          match that of `x`.
        name: Optional name for the op.
  
      Returns:
        masked: A broadcast-shaped `Tensor` where elements corresponding to `True`
          values of `condition` come from `x`, and others come from `y`.
      """
      with tf.name_scope(name or "VM.where"):
          condition = tf.convert_to_tensor(
              value=condition, name="condition"
          )
          dtype = getattr(x, "dtype", getattr(y, "dtype", None))
          x = tf.convert_to_tensor(value=x, name="x", dtype=dtype)
          y = tf.convert_to_tensor(value=y, name="y", dtype=x.dtype)
          return tf1.where(condition, x, y)
  
imports: import collections
  import contextlib
  import six
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.auto_batching import instructions
  from tensorflow_probability.python.experimental.auto_batching import xla
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow.python.ops import control_flow_util
label_desc: Use image node_id 16 for calling the TensorFlowBackend obj's underlying member method code with example usage: obj.where(condition, x, y, name) and returns: tf1