class_docstr: Implements the Numpy backend ops for a PC auto-batching VM.
class_docstr_tok: ["Implements","the","Numpy","backend","ops","for","a","PC","auto-batching","VM","."]
docstr: Implements a conditional operation for the backend.
  
  Args:
    pred: A Python or Numpy `bool` scalar indicating the condition.
    true_fn: A callable accepting and returning nests of `np.ndarray`s
      with the same structure as `state`, to be executed when `pred` is True.
    false_fn: A callable accepting and returning nests of `np.ndarray`s with
      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","Python","or","Numpy","`","bool","`","scalar","indicating","the","condition",".","true_fn",":","A","callable","accepting","and","returning","nests","of","`","np.ndarray","`","s","with","the","same","structure","as","`","state","`",",","to","be","executed","when","`","pred","`","is","True",".","false_fn",":","A","callable","accepting","and","returning","nests","of","`","np.ndarray","`","s","with","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 Python or Numpy `bool` scalar indicating the condition.
        true_fn: A callable accepting and returning nests of `np.ndarray`s
          with the same structure as `state`, to be executed when `pred` is True.
        false_fn: A callable accepting and returning nests of `np.ndarray`s with
          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`.
      """
      del name
      if pred:
          return true_fn()
      else:
          return false_fn()
  
imports: import collections
  import numpy
  from tensorflow_probability.python.experimental.auto_batching import instructions
label_desc: Use image node_id 13 for calling the NumpyBackend obj's underlying member method code with example usage: obj.cond(pred, true_fn, false_fn, name) and returns: true_fn, false_fn