code: def test_aliased_outputs_bad(self):
      # here the alias between outputs is not ok because destroying one
      # destroys the other, but there's no way to warn theano about it
      # through the view_map mechanism.
      class CustomOp(gof.Op):
          def make_node(self, a, b):
              c = a.type()
              d = a.type()
              return gof.Apply(self, [a, b], [c, d])
  
          def perform(self, node, inp, out):
              a, b = inp
              c, d = out
              r = a * 1
              c[0] = r[:-1]
              d[0] = r[1:]
  
      custom_op = CustomOp()
  
      x = theano.tensor.dvector()
      y = theano.tensor.dvector()
      bad_xy0, bad_xy1 = custom_op(x, y)
      out = bad_xy0 * 2 + bad_xy1 * 2
      f = theano.function([x, y], out, mode="DEBUG_MODE")
  
      try:
          f([1, 2, 3, 4], [5, 6, 7, 8])
          assert False  # DebugMode should have caught the error
      except debugmode.BadViewMap:
          # print e
          pass
  
imports: from __future__ import absolute_import, print_function, division
  import sys
  import unittest
  from nose.plugins.skip import SkipTest
  import numpy
  from six import reraise
  from theano import config
  from theano import gof
  import theano
  from theano.compat import exc_message
  from theano.compile import debugmode
  import theano.tensor
  from theano.tests import unittest_tools
label_desc: Use image node_id 8 for calling the Test_ViewMap obj's underlying member method code with example usage: obj.test_aliased_outputs_bad() and returns: gof