code: def cond_make_inplace(fgraph, 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(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, name=op.name)(
              *node.inputs, return_list=True
          )
      return False
  
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 2 for calling a global function with example usage: cond_make_inplace(fgraph, node) and returns: False, IfElse