code: def test_simple_merge():
      r"""Test composite function is correctly produced from simple graph.
  
      We could expect the pattern `make_add_relu_pattern` to be merged
      into a single op `add_relu`.
  
          a  b
          \ /               a  b
          add    ====>      \ /
           |             add_relu
         relu
  
      """
      pattern_table = [("add_relu", make_add_relu_pattern())]
  
      def before():
          a = relay.var("a", shape=(10, 10))
          b = relay.var("b", shape=(10, 10))
          add_node = relay.add(a, b)
          r = relay.nn.relu(add_node)
          return relay.Function([a, b], r)
  
      def expected():
          a = relay.var("a", shape=(10, 10))
          b = relay.var("b", shape=(10, 10))
  
          # add_relu function
          in_1 = relay.var("in_1", shape=(10, 10))
          in_2 = relay.var("in_2", shape=(10, 10))
          add_node = relay.add(in_1, in_2)
          relu_node = relay.nn.relu(add_node)
          add_relu = relay.Function([in_1, in_2], relu_node)
          add_relu = add_relu.with_attr("Composite", "add_relu")
          add_relu = add_relu.with_attr(
              "PartitionedFromPattern", "add_nn.relu_"
          )
  
          # merged function
          r = relay.Call(add_relu, [a, b])
          return relay.Function([a, b], r)
  
      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 8 for calling a global function with example usage: test_simple_merge() and returns: relay, relay