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 = create_fgraph([x, y], [e_1, e_2], False)
      assert g.consistent()
  
      # try to work in-place on x/0 and y/1 (this should fail)
      fail = FailureWatch()
      TopoSubstitutionNodeRewriter(
          multiple, multiple_in_place_0_1, fail
      ).rewrite(g)
      assert g.consistent()
      assert fail.failures == 1
  
      # try to work in-place on x/0 (this should fail)
      fail = FailureWatch()
      TopoSubstitutionNodeRewriter(
          multiple, multiple_in_place_0, fail
      ).rewrite(g)
      assert g.consistent()
      assert fail.failures == 1
  
      # try to work in-place on y/1 (this should succeed)
      fail = FailureWatch()
      TopoSubstitutionNodeRewriter(
          multiple, multiple_in_place_1, fail
      ).rewrite(g)
      assert g.consistent()
      assert fail.failures == 0
  
      # try to work in-place on x/0 and y/1 (this should still fail)
      fail = FailureWatch()
      TopoSubstitutionNodeRewriter(
          multiple_in_place_1, multiple_in_place_0_1, fail
      ).rewrite(g)
      assert g.consistent()
      assert fail.failures == 1
  
imports: from copy import copy
  import pytest
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply, Constant, Variable, clone
  from pytensor.graph.destroyhandler import DestroyHandler
  from pytensor.graph.features import ReplaceValidate
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.op import Op
  from pytensor.graph.rewriting.basic import NodeProcessingGraphRewriter, OpKeyGraphRewriter, PatternNodeRewriter, SubstitutionNodeRewriter, WalkingGraphRewriter
  from pytensor.graph.type import Type
  from pytensor.graph.utils import InconsistencyError
  from tests.unittest_tools import assertFailure_fast
label_desc: Use image node_id 32 for calling a global function with example usage: test_multiple_inplace() without return types