class_docstr: Implements the TF backend ops for a PC auto-batching VM.
docstr: Broadcasts val to the shape of target.
  
  Attempts to match the dtype of `broadcast_val` to the dtype of `target`, if
  `val` is not a `Tensor` and `target` has a dtype.
  
  Args:
    val: The value to be broadcast. Must be broadcast-compatible with
      `target`.
    target: `Tensor` whose shape we will broadcast `val` to match.
    name: Optional name for the op.
  
  Returns:
    broadcast_val: A `Tensor` with shape matching `val + target`. Provided
      that `val`'s dimension sizes are all smaller or equal to `target`'s, the
      returned value will be the shape of `target`.
docstr_tok: ["Broadcasts","val","to","the","shape","of","target",".","Attempts","to","match","the","dtype","of","`","broadcast_val","`","to","the","dtype","of","`","target","`",",","if","`","val","`","is","not","a","`","Tensor","`","and","`","target","`","has","a","dtype",".","Args",":","val",":","The","value","to","be","broadcast",".","Must","be","broadcast-compatible","with","`","target","`",".","target",":","`","Tensor","`","whose","shape","we","will","broadcast","`","val","`","to","match",".","name",":","Optional","name","for","the","op",".","Returns",":","broadcast_val",":","A","`","Tensor","`","with","shape","matching","`","val","+","target","`",".","Provided","that","`","val","`","'s","dimension","sizes","are","all","smaller","or","equal","to","`","target","`","'s",",","the","returned","value","will","be","the","shape","of","`","target","`","."]
code: def broadcast_to_shape_of(self, val, target, name=None):
      """Broadcasts val to the shape of target.
  
      Attempts to match the dtype of `broadcast_val` to the dtype of `target`, if
      `val` is not a `Tensor` and `target` has a dtype.
  
      Args:
        val: The value to be broadcast. Must be broadcast-compatible with
          `target`.
        target: `Tensor` whose shape we will broadcast `val` to match.
        name: Optional name for the op.
  
      Returns:
        broadcast_val: A `Tensor` with shape matching `val + target`. Provided
          that `val`'s dimension sizes are all smaller or equal to `target`'s, the
          returned value will be the shape of `target`.
      """
      # TODO(b/78594182): This is a compatibility shim, required because
      # `tf1.where` does not support broadcasting of its value operands.
      with tf.name_scope(name or "VM.broadcast_to_shape_of"):
          dtype = getattr(target, "dtype", getattr(val, "dtype", None))
          target = tf.convert_to_tensor(
              value=target, name="target", dtype=dtype
          )
          val = tf.convert_to_tensor(
              value=val, name="val", dtype=target.dtype
          )
          if val.dtype == tf.bool:
              return val | tf.zeros_like(target, dtype=val.dtype)
          return val + tf.zeros_like(target, dtype=val.dtype)
  
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 13 for calling the TensorFlowBackend obj's underlying member method code with example usage: obj.broadcast_to_shape_of(val, target, name) and returns: unknown, unknown