code: def test_multiple_inplace():
      # this tests issue #5223
      # there were some problems with Ops that have more than
      # one in-place input.
      x, y, z = inputs()
      # we will try to replace this op with an in-place version
      m = multiple(x, y)
      # this makes it impossible to run in-place on x
      e_1 = dot(m[0], x)
      # try to confuse the DestroyHandler: this dot Op can run
      # before multiple and then multiple can still run in-place on y
      e_2 = dot(y, y)
      g = Env([x, y], [e_1, e_2], False)
      consistent(g)
  
      # try to work in-place on x/0 and y/1 (this should fail)
      fail = FailureWatch()
      OpSubOptimizer(multiple, multiple_in_place_0_1, fail).optimize(g)
      consistent(g)
      assert fail.failures == 1
  
      # try to work in-place on x/0 (this should fail)
      fail = FailureWatch()
      OpSubOptimizer(multiple, multiple_in_place_0, fail).optimize(g)
      consistent(g)
      assert fail.failures == 1
  
      # try to work in-place on y/1 (this should succeed)
      fail = FailureWatch()
      OpSubOptimizer(multiple, multiple_in_place_1, fail).optimize(g)
      consistent(g)
      assert fail.failures == 0
  
      # try to work in-place on x/0 and y/1 (this should still fail)
      fail = FailureWatch()
      OpSubOptimizer(
          multiple_in_place_1, multiple_in_place_0_1, fail
      ).optimize(g)
      consistent(g)
      assert fail.failures == 1
  
imports: from __future__ import absolute_import, print_function, division
  from six.moves import xrange
  from theano.gof.type import Type
  from theano.gof import graph
  from theano.gof.graph import Variable, Apply
  from theano.gof.op import Op
  from theano.gof.opt import OpKeyOptimizer, PatternSub, NavigatorOptimizer, TopoOptimizer, OpSub
  from theano.gof import destroyhandler
  from theano.gof.fg import FunctionGraph, InconsistencyError
  from theano.gof.toolbox import ReplaceValidate
  from theano.tests.unittest_tools import assertFailure_fast
  from theano import change_flags
  from copy import copy
label_desc: Use image node_id 34 for calling a global function with example usage: test_multiple_inplace() without return types