code: def test_no_aliasing_2b(self):
      # B and A take one another's values
      # no copying is necessary since each one is updated.
      # The twist one `test_no_aliasing_2` is that each shared var is updated
      # with a view of the other one.
  
      orig_a = np.zeros((2, 2)) + 0.5
      orig_b = np.zeros((2, 2)) - 0.5
      A = self.shared(orig_a)
      B = self.shared(orig_b)
  
      data_of_a = data_of(A)
      data_of_b = data_of(B)
  
      f = pfunc([], [], updates=[(A, B[:, ::-1]), (B, A.T)])
      # theano.printing.debugprint(f)
      f()
      # correctness (doesn't actually test the view...)
      assert np.all(data_of(A) == -0.5)
      assert np.all(data_of(B) == +0.5)
  
      # shared vars may not be aliased
      assert not np.may_share_memory(data_of(A), data_of(B))
  
      # theano should have been smart enough to not make copies
      if theano.config.mode not in [
          "DebugMode",
          "DEBUG_MODE",
          "FAST_COMPILE",
      ]:
          # We don't ask DebugMode and FAST_COMPILE not to make copy.
          # We have the right to do so.
          assert np.all(data_of(A) < 5)
          data_of_b += 10
          assert np.all(data_of(A) > 5)
          data_of_b -= 10
  
          assert np.all(data_of(B) < 5)
          data_of_a += 10
          assert np.all(data_of(B) > 5)
          data_of_a -= 10
  
          # N.B. may_share_memory is what we mean, but does it work?
          assert np.may_share_memory(data_of(A), data_of_b)
          assert np.may_share_memory(data_of(B), data_of_a)
  
imports: from __future__ import absolute_import, print_function, division
  import unittest
  from nose.plugins.skip import SkipTest
  import numpy
  import theano
  from theano.tensor import dmatrix, iscalar, lscalar, dmatrices
  from theano import tensor
  from theano.compile import In
  from theano.compile import pfunc
  from theano.compile import shared
  from theano.compile import config
label_desc: Use image node_id 10 for calling the Test_aliasing_rules obj's underlying member method code with example usage: obj.test_no_aliasing_2b() without return types