class_docstr: Implements the TF backend ops for a PC auto-batching VM.
docstr: Implements a conditional operation for the backend.
  
  Args:
    pred: A boolean scalar `Tensor` indicating the condition.
    true_fn: A callable accepting and returning nests of `Tensor`s having
      the same structure as `state`, to be executed when `pred` is True.
    false_fn: A callable accepting and returning nests of `Tensor`s having
      the same structure as `state`, to be executed when `pred` is False.
    name: Optional name for the op.
  
  Returns:
    state: Output state, matching nest structure of input argument `state`.
docstr_tok: ["Implements","a","conditional","operation","for","the","backend",".","Args",":","pred",":","A","boolean","scalar","`","Tensor","`","indicating","the","condition",".","true_fn",":","A","callable","accepting","and","returning","nests","of","`","Tensor","`","s","having","the","same","structure","as","`","state","`",",","to","be","executed","when","`","pred","`","is","True",".","false_fn",":","A","callable","accepting","and","returning","nests","of","`","Tensor","`","s","having","the","same","structure","as","`","state","`",",","to","be","executed","when","`","pred","`","is","False",".","name",":","Optional","name","for","the","op",".","Returns",":","state",":","Output","state",",","matching","nest","structure","of","input","argument","`","state","`","."]
code: def cond(self, pred, true_fn, false_fn, name=None):
      """Implements a conditional operation for the backend.
  
      Args:
        pred: A boolean scalar `Tensor` indicating the condition.
        true_fn: A callable accepting and returning nests of `Tensor`s having
          the same structure as `state`, to be executed when `pred` is True.
        false_fn: A callable accepting and returning nests of `Tensor`s having
          the same structure as `state`, to be executed when `pred` is False.
        name: Optional name for the op.
  
      Returns:
        state: Output state, matching nest structure of input argument `state`.
      """
      with tf.name_scope(name or "VM.cond"):
          with _control_flow_v2():
              return tf.cond(
                  pred=pred, true_fn=true_fn, false_fn=false_fn
              )
  
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 14 for calling the TensorFlowBackend obj's underlying member method code with example usage: obj.cond(pred, true_fn, false_fn, name) and returns: tf