code: def test_resnet_pool_uses_specified_convert_layout():
      def before():
          x = relay.var("x", shape=(1, 56, 56, 64))
          weight1 = relay.var("weight1", shape=(3, 3, 64, 32))
          weight2 = relay.var("weight2", shape=(1, 1, 64, 32))
          y = relay.nn.conv2d(
              x,
              weight1,
              channels=32,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="NHWC",
              kernel_layout="HWIO",
          )
          y = relay.nn.relu(y)
          y2 = relay.nn.conv2d(
              x,
              weight2,
              channels=32,
              kernel_size=(1, 1),
              data_layout="NHWC",
              kernel_layout="HWIO",
          )
          y2 = relay.nn.relu(y2)
          y = y + y2
          y = relay.nn.global_max_pool2d(y, layout="NHWC")
          return relay.Function(analysis.free_vars(y), y)
  
      def expected():
          x = relay.var("x", shape=(1, 56, 56, 64))
          weight1 = relay.var("weight1", shape=(3, 3, 64, 32))
          weight2 = relay.var("weight2", shape=(1, 1, 64, 32))
          weight1 = relay.layout_transform(weight1, "HWIO", "OIHW")
          weight2 = relay.layout_transform(weight2, "HWIO", "OIHW")
          x = relay.layout_transform(x, "NHWC", "NCHW")
          y = relay.nn.conv2d(
              x,
              weight1,
              channels=32,
              kernel_size=(3, 3),
              padding=(1, 1),
          )
          y = relay.nn.relu(y)
          y2 = relay.nn.conv2d(
              x, weight2, channels=32, kernel_size=(1, 1)
          )
          y2 = relay.nn.relu(y2)
          y = y + y2
          y = relay.layout_transform(y, "NCHW", "NHWC")
          y = relay.nn.global_max_pool2d(
              y, layout="NHWC", out_layout="NHWC"
          )
          return relay.Function(analysis.free_vars(y), y)
  
      a = before()
      a = run_opt_pass(
          a,
          transform.ConvertLayout(
              {
                  "nn.conv2d": ["NCHW", "default"],
                  "nn.global_max_pool2d": ["NHWC"],
              }
          ),
      )
      b = run_opt_pass(expected(), transform.InferType())
  
      assert tvm.ir.structural_equal(a, b), (
          "Actual = \n" + str(a) + "\n\n Expected = \n" + str(b)
      )
  
imports: import pytest
  import tvm
  from tvm import relay, te
  from tvm.relay import analysis, transform
  from tvm.relay.op import op
  from tvm.relay.op import register_alter_op_layout
  from tvm.relay.quantize._annotate import attach_simulated_quantize, QAnnotateKind
  from tvm.relay.transform.infer_layout_utils import InferCorrectLayoutOutput
label_desc: Use image node_id 17 for calling a global function with example usage: test_resnet_pool_uses_specified_convert_layout() and returns: relay, relay