code: def test_pattern_with_check():
      def before():
          x = relay.var("x", shape=(1, 10, 10, 10))
          w = relay.var("w", shape=(10, 10, 3, 3))
          b = relay.var("b", shape=(8,))
          conv = relay.nn.conv2d(
              x,
              w,
              kernel_size=(3, 3),
              kernel_layout="OIHW",
              data_layout="NHWC",
          )
          bias = relay.nn.bias_add(conv, b)
          relu = relay.nn.relu(bias)
          return relay.Function([x, w, b], relu)
  
      def _check_true(extract):
          conv = extract.args[0].args[0]
          return conv.attrs.data_layout == "NHWC"
  
      def _check_false(extract):
          conv = extract.args[0].args[0]
          return conv.attrs.data_layout == "NCHW"
  
      def expected():
          x = relay.var("x")
          w = relay.var("w")
          b = relay.var("b")
          conv = relay.nn.conv2d(
              x,
              w,
              kernel_size=(3, 3),
              kernel_layout="OIHW",
              data_layout="NHWC",
          )
          bias = relay.nn.bias_add(conv, b)
          relu = relay.nn.relu(bias)
          func = relay.Function([x, w, b], relu)
          func = func.with_attr("Composite", "conv_bias_relu")
          func = func.with_attr(
              "PartitionedFromPattern", "nn.conv2d_nn.bias_add_nn.relu_"
          )
  
          x = relay.var("x", shape=(1, 10, 10, 10))
          w = relay.var("w", shape=(10, 10, 3, 3))
          b = relay.var("b", shape=(8,))
          return relay.Function([x, w, b], func(x, w, b))
  
      pattern_table_false = [
          (
              "conv_bias_relu",
              make_conv_bias_relu_pattern(),
              _check_false,
          )
      ]
      check_result(pattern_table_false, before(), before())
  
      pattern_table_true = [
          ("conv_bias_relu", make_conv_bias_relu_pattern(), _check_true)
      ]
      check_result(pattern_table_true, 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 17 for calling a global function with example usage: test_pattern_with_check() and returns: relay, unknown, unknown, relay