class_docstr: Op that provides conditional graph evaluation if used with the CVM/VM
  linkers. Note that there exist a helpful function `ifelse` that should
  be used to instantiate the op!
  
  According to a scalar condition `condition` the 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` as on the `else` and there is a one
  to one correspondence between them (shape and dtype wise).
  
  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:
  
      ``rval = ifelse(condition, rval_if_true1, .., rval_if_trueN,
                      rval_if_false1, rval_if_false2, .., rval_if_falseN)``
  
  :note:
      Other Linkers then CVM and VM are INCOMPATIBLE with this Op, and
      will ignore its lazy characteristic, computing both the True and
      False branch before picking one.
class_docstr_tok: ["Op","that","provides","conditional","graph","evaluation","if","used","with","the","CVM\/VM","linkers",".","Note","that","there","exist","a","helpful","function","`","ifelse","`","that","should","be","used","to","instantiate","the","op","!","According","to","a","scalar","condition","`","condition","`","the","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","`","as","on","the","`","else","`","and","there","is","a","one","to","one","correspondence","between","them","(","shape","and","dtype","wise",")",".","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",":","``","rval","=","ifelse","(","condition",",","rval_if_true1",",","..",",","rval_if_trueN",",","rval_if_false1",",","rval_if_false2",",","..",",","rval_if_falseN",")","``",":","note",":","Other","Linkers","then","CVM","and","VM","are","INCOMPATIBLE","with","this","Op",",","and","will","ignore","its","lazy","characteristic",",","computing","both","the","True","and","False","branch","before","picking","one","."]
code: def make_thunk(
      self, node, storage_map, compute_map, no_recycling, impl=None
  ):
      cond = node.inputs[0]
      ts = node.inputs[1:][: self.n_outs]
      fs = 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 xrange(self.n_outs)
                      if not compute_map[ts[idx]][0]
                  ]
                  if len(ls) > 0:
                      return ls
                  else:
                      for out, t in izip(outputs, ts):
                          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 type(val) in (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 xrange(self.n_outs)
                      if not compute_map[fs[idx]][0]
                  ]
                  if len(ls) > 0:
                      return ls
                  else:
                      for out, f in izip(outputs, fs):
                          compute_map[out][0] = 1
                          # can't view both outputs unless destroyhandler
                          # improves
                          # Work around broken numpy deepcopy
                          val = storage_map[f][0]
                          if type(val) in (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 __future__ import absolute_import, print_function, division
  from copy import deepcopy
  from theano.compat import izip
  import logging
  import numpy
  import theano.tensor
  from theano.tensor import TensorType
  from theano import gof
  from theano.gof import Op, Apply
  from six import iteritems
  from six.moves import xrange
  from theano.compile import optdb
  from theano.tensor import opt
  from theano.scan_module.scan_utils import clone
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