code: def test_inplace_optimization(self):
      # Test that FAST_RUN includes the random_make_inplace optimization
      # inplace = False
      rf2 = RandomFunction(
          np.random.RandomState.uniform, tensor.dvector
      )
      rng_R = random_state_type()
  
      # If calling RandomFunction directly, all args have to be specified,
      # because shape will have to be moved to the end
      post_r2, out2 = rf2(rng_R, (4,), 0.0, 1.0)
  
      f = compile.function(
          [
              compile.In(
                  rng_R,
                  value=np.random.RandomState(utt.fetch_seed()),
                  update=post_r2,
                  mutable=True,
              )
          ],
          out2,
          mode="FAST_RUN",
      )  # DEBUG_MODE can't pass the id-based
      # test below
  
      # test that the RandomState object stays the same from function call to
      # function call, but that the values returned change from call to call.
  
      id0 = id(f[rng_R])
      val0 = f()
      assert id0 == id(f[rng_R])
      val1 = f()
      assert id0 == id(f[rng_R])
  
      assert not np.allclose(val0, val1)
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import pickle
  from theano.tests import unittest_tools
  from theano.tensor.raw_random import *
  from theano.tensor import raw_random, ivector, dvector, iscalar, dcol, dtensor3
  from theano import tensor
  from theano import compile, config, gof
label_desc: Use image node_id 5 for calling the T_random_function obj's underlying member method code with example usage: obj.test_inplace_optimization() without return types