code: def test_partial_input_aliasing_affecting_inplace_operations(self):
      # Note: to trigger this bug with theano rev 4586:2bc6fc7f218b,
      #        you need to make in inputs mutable ( so that inplace
      #        operations are used) and to break the elemwise composition
      #        with some non-elemwise op ( here dot )
      x = theano.tensor.dvector()
      y = theano.tensor.dvector()
      z = theano.tensor.dvector()
      m1 = theano.tensor.dmatrix()
      m2 = theano.tensor.dmatrix()
      m3 = theano.tensor.dmatrix()
  
      # Test 2. If variables only partial overlap
      #   more exactly we care about the case when we have a,b,c
      #   and a shares memory with b, b shares memory with c, but
      #   c does not share memory with a
  
      f = theano.function(
          [
              theano.In(x, mutable=True),
              theano.In(y, mutable=True),
              theano.In(z, mutable=True),
              theano.In(m1, mutable=True),
              theano.In(m2, mutable=True),
              theano.In(m3, mutable=True),
          ],
          (
              theano.dot((x * 2), m1)
              + theano.dot((y * 3), m2)
              + theano.dot((z * 4), m3)
          ),
      )
  
      # Compute bogus values
      v = np.asarray([1, 2, 3, 4, 5], dtype="float64")
      m = np.asarray([[1, 0], [0, 1]], dtype="float64")
      bogus_vals = f(v[:2], v[1:3], v[2:4], m, m, m)
      # Since we used inplace operation v and m may be corrupted
      # so we need to recreate them
  
      v = np.asarray([1, 2, 3, 4, 5], dtype="float64")
      m = np.asarray([[1, 0], [0, 1]], dtype="float64")
      m_copy1 = m.copy()
      v_copy1 = v.copy()
      m_copy2 = m.copy()
      v_copy2 = v.copy()
      vals = f(v[:2], v_copy1[1:3], v_copy2[2:4], m, m_copy1, m_copy2)
  
      assert np.allclose(vals, bogus_vals)
  
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 5 for calling the Test_aliasing_rules obj's underlying member method code with example usage: obj.test_partial_input_aliasing_affecting_inplace_operations() without return types