code: def cond_make_inplace(node):
      op = node.op
      if (
          isinstance(op, IfElse)
          and not op.as_view
          and
          # For big graph, do not make inplace scalar to speed up
          # optimization.
          (
              len(node.fgraph.apply_nodes) < 500
              or not all(
                  [
                      getattr(o.type, "ndim", -1) == 0
                      for o in node.outputs
                  ]
              )
          )
      ):
          return IfElse(
              n_outs=op.n_outs, as_view=True, gpu=op.gpu, name=op.name
          )(*node.inputs, **dict(return_list=True))
      return False
  
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 2 for calling a global function with example usage: cond_make_inplace(node) and returns: False, IfElse