code: def test_not_lazy_if_inplace(self):
      # Tests that if the outputs are scalars and the graph is big,
      # we disable the inplace opt to speed up optimization
      x = tensor.vector("x", dtype=self.dtype)
      y = tensor.vector("y", dtype=self.dtype)
      c = tensor.iscalar("c")
      mode = theano.compile.get_mode(self.mode).excluding(
          # Disable many opt to keep the graph big enough to disable
          # the opt.
          "fusion",
          "local_add_canonizer",
          "inplace",
          "constant_folding",
          "constant_folding",
      )
      y2 = reduce(lambda x, y: x + y, [y] + list(range(200)))
      f = theano.function([c, x, y], ifelse(c, x, y2), mode=mode)
      # For not inplace ifelse
      ifnode = [
          n
          for n in f.maker.fgraph.toposort()
          if isinstance(n.op, IfElse)
      ]
      assert len(ifnode) == 1
      assert not ifnode[0].op.as_view
      rng = np.random.RandomState(utt.fetch_seed())
  
      xlen = rng.randint(200)
      ylen = rng.randint(200)
  
      vx = np.asarray(rng.uniform(size=(xlen,)), self.dtype)
      vy = np.asarray(rng.uniform(size=(ylen,)), self.dtype)
  
      assert np.allclose(vx, f(1, vx, vy))
      assert np.allclose(vy + sum(range(200)), f(0, vx, vy))
  
imports: from __future__ import absolute_import, print_function, division
  import unittest
  import numpy
  from nose.plugins.skip import SkipTest
  from six.moves import reduce
  import theano
  from theano import tensor
  import theano.ifelse
  from theano.ifelse import IfElse, ifelse
  from theano.tests import unittest_tools
label_desc: Use image node_id 3 for calling the test_ifelse obj's underlying member method code with example usage: obj.test_not_lazy_if_inplace() without return types