code: def test_merge_opt_runtime():
      # In the original merge optimization, the following graph took
      # like caused the MERGE optimizer to exhibit really bad performance
      # (quadratic? exponential?)
      #
      # Ironically, there is actually no merging to do in this graph.
  
      x = T.dvector()
      for i in xrange(50):
          if i:
              r = r + r / 10
          else:
              r = x
      t = time.time()
      f = theano.function([x], r, mode="FAST_COMPILE")
      # FAST_RUN does in-place optimizer which requires a lot of
      # toposorting, which is actually pretty slow at the moment.  This
      # test was designed to test MergeOptimizer... so I'm leaving
      # toposort optimizations for a later date.
      dt = time.time() - t
  
      # it should never take longer than 5 seconds to compile this graph
      assert dt < 5.0, dt
  
file_path: Theano/theano/tensor/tests/test_gc.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import six.moves.cPickle
  from six.moves import xrange
  import theano
  from theano import tensor
  import time
label_desc: Use image node_id 3 for calling a global function with example usage: test_merge_opt_runtime() without return types