class_docstr: An `Op` that provides conditional graph evaluation.
  
  According to a scalar condition, this `Op` evaluates and then
  returns all the tensors provided on the "then"-branch, otherwise it
  evaluates and returns the tensors provided on the "else"-branch. The `Op`
  supports multiple tensors on each branch, with the condition that the same
  number of tensors are on the "then"-branch as on the "else"-branch and
  there is a one to one correspondence between their dtypes and numbers of
  dimensions.
  
  The "then"-branch is defined as the first ``N`` tensors (after the
  condition), while the "else"-branch is defined as the last ``N`` tensors.
  
  Example usage:
  
  .. code-block::
  
      rval = ifelse(condition,
                    rval_if_true_1, ..., rval_if_true_N,
                    rval_if_false_1, ..., rval_if_false_N)
  
  .. note:
  
      `Linker`\s other than `CVM`, and some other `VM` subclasses, are
      incompatible with this `Op`, and will ignore its lazy characteristic,
      computing both the true and false branches before returning one.
code: def make_thunk(
      self, node, storage_map, compute_map, no_recycling, impl=None
  ):
      cond = node.inputs[0]
      input_true_branch = node.inputs[1:][: self.n_outs]
      inputs_false_branch = node.inputs[1:][self.n_outs :]
      outputs = node.outputs
  
      def thunk():
          if not compute_map[cond][0]:
              return [0]
          else:
              truthval = storage_map[cond][0]
              if truthval != 0:
                  ls = [
                      idx + 1
                      for idx in range(self.n_outs)
                      if not compute_map[input_true_branch[idx]][0]
                  ]
                  if len(ls) > 0:
                      return ls
                  else:
                      for out, t in zip(outputs, input_true_branch):
                          compute_map[out][0] = 1
                          val = storage_map[t][0]
                          if self.as_view:
                              storage_map[out][0] = val
                          # Work around broken numpy deepcopy
                          elif isinstance(val, (np.ndarray, np.memmap)):
                              storage_map[out][0] = val.copy()
                          else:
                              storage_map[out][0] = deepcopy(val)
                      return []
              else:
                  ls = [
                      1 + idx + self.n_outs
                      for idx in range(self.n_outs)
                      if not compute_map[inputs_false_branch[idx]][0]
                  ]
                  if len(ls) > 0:
                      return ls
                  else:
                      for out, f in zip(outputs, inputs_false_branch):
                          compute_map[out][0] = 1
                          # can't view both outputs unless destroyhandler
                          # improves
                          # Work around broken numpy deepcopy
                          val = storage_map[f][0]
                          if isinstance(val, (np.ndarray, np.memmap)):
                              storage_map[out][0] = val.copy()
                          else:
                              storage_map[out][0] = deepcopy(val)
                      return []
  
      thunk.lazy = True
      thunk.inputs = [storage_map[v] for v in node.inputs]
      thunk.outputs = [storage_map[v] for v in node.outputs]
      return thunk
  
imports: from collections.abc import Sequence
  from copy import deepcopy
  from typing import TYPE_CHECKING, Any, Optional, Union
  import numpy
  import pytensor.tensor
  from pytensor import as_symbolic
  from pytensor.compile import optdb
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply, Variable, apply_depends_on
  from pytensor.graph.op import _NoPythonOp
  from pytensor.graph.replace import clone_replace
  from pytensor.graph.rewriting.basic import GraphRewriter, in2out, node_rewriter
  from pytensor.graph.type import HasDataType, HasShape
  from pytensor.tensor.shape import Reshape, Shape, SpecifyShape, Unbroadcast
label_desc: Use image node_id 9 for calling the IfElse obj's underlying member method code with example usage: obj.make_thunk(node, storage_map, compute_map, no_recycling, impl) and returns: thunk, list, ls, list, ls, list