code: def test_default_updates(self):
      # Basic case: default_updates
      random_a = RandomStreams(utt.fetch_seed())
      out_a = random_a.uniform((2, 2))
      fn_a = function([], out_a)
      fn_a_val0 = fn_a()
      fn_a_val1 = fn_a()
      assert not np.all(fn_a_val0 == fn_a_val1)
  
      nearly_zeros = function([], out_a + out_a - 2 * out_a)
      assert np.all(abs(nearly_zeros()) < 1e-5)
  
      # Explicit updates #1
      random_b = RandomStreams(utt.fetch_seed())
      out_b = random_b.uniform((2, 2))
      fn_b = function([], out_b, updates=random_b.updates())
      fn_b_val0 = fn_b()
      fn_b_val1 = fn_b()
      assert np.all(fn_b_val0 == fn_a_val0)
      assert np.all(fn_b_val1 == fn_a_val1)
  
      # Explicit updates #2
      random_c = RandomStreams(utt.fetch_seed())
      out_c = random_c.uniform((2, 2))
      fn_c = function([], out_c, updates=[out_c.update])
      fn_c_val0 = fn_c()
      fn_c_val1 = fn_c()
      assert np.all(fn_c_val0 == fn_a_val0)
      assert np.all(fn_c_val1 == fn_a_val1)
  
      # No updates at all
      random_d = RandomStreams(utt.fetch_seed())
      out_d = random_d.uniform((2, 2))
      fn_d = function([], out_d, no_default_updates=True)
      fn_d_val0 = fn_d()
      fn_d_val1 = fn_d()
      assert np.all(fn_d_val0 == fn_a_val0)
      assert np.all(fn_d_val1 == fn_d_val0)
  
      # No updates for out
      random_e = RandomStreams(utt.fetch_seed())
      out_e = random_e.uniform((2, 2))
      fn_e = function([], out_e, no_default_updates=[out_e.rng])
      fn_e_val0 = fn_e()
      fn_e_val1 = fn_e()
      assert np.all(fn_e_val0 == fn_a_val0)
      assert np.all(fn_e_val1 == fn_e_val0)
  
imports: from __future__ import absolute_import, print_function, division
  import sys
  import unittest
  import numpy
  from theano.tensor import raw_random
  from theano.tensor.shared_randomstreams import RandomStreams
  from theano import function, shared
  from theano import tensor
  from theano import compile, config, gof
  from theano.tests import unittest_tools
label_desc: Use image node_id 16 for calling the T_SharedRandomStreams obj's underlying member method code with example usage: obj.test_default_updates() without return types