code: def test_einsum_reshape_pattern():
      """Test MergeComposite does not cause error with einsum operator."""
  
      def make_einsum_reshape_pattern():
          x = wildcard()
          x = is_op("reshape")(x) | x
          y = wildcard()
          y = is_op("reshape")(y) | y
          z = is_op("einsum")(TuplePattern([x, y]))
          r = is_op("reshape")(z) | z
          return r
  
      pattern_table = [
          (
              "einsum_reshape",
              make_einsum_reshape_pattern(),
          )
      ]
  
      def before():
          a = relay.var("a", shape=(10, 10))
          b = relay.var("b", shape=(10, 10))
          c = relay.reshape(a, [20, 5])
          d = relay.reshape(b, [20, 5])
          r = relay.einsum([c, d], "...ab,...cb->...ac")
          return relay.Function([a, b], r)
  
      def expected():
          a = relay.var("a", shape=(10, 10))
          b = relay.var("b", shape=(10, 10))
          c = relay.reshape(a, [20, 5])
          d = relay.reshape(b, [20, 5])
          r = relay.einsum([c, d], "...ab,...cb->...ac")
          func = relay.Function([a, b], r)
          func = func.with_attr("Composite", "einsum_reshape")
          func = func.with_attr(
              "PartitionedFromPattern", "reshape_reshape_Tuple_einsum_"
          )
  
          input0 = relay.var("a", shape=(10, 10))
          input1 = relay.var("b", shape=(10, 10))
          output = func(input0, input1)
          return relay.Function([input0, input1], output)
  
      check_result(pattern_table, before(), expected())
  
imports: import pytest
  import tvm
  from tvm import relay, tir
  from tvm.relay.dataflow_pattern import TuplePattern, TupleGetItemPattern, is_op, wildcard
  from tvm.relay.testing import run_opt_pass
label_desc: Use image node_id 20 for calling a global function with example usage: test_einsum_reshape_pattern() and returns: r, relay, relay