code: def test_convert_with_config():
      def before():
          x = relay.var("x", shape=(1, 56, 56, 64))
          weight = relay.var("weight", shape=(3, 3, 64, 64))
          y = relay.nn.conv2d(
              x,
              weight,
              channels=64,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="NHWC",
              kernel_layout="HWIO",
          )
          y = relay.nn.relu(y)
  
          weight2 = relay.var("weight2", shape=(3, 3, 64, 64))
          y2 = relay.nn.conv2d(
              y,
              weight2,
              channels=64,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="NHWC",
              kernel_layout="HWIO",
          )
          y2 = relay.nn.relu(y2)
  
          out = relay.Function([x, weight, weight2], y2)
          return out
  
      def expected():
          x = relay.var("x", shape=(1, 56, 56, 64))
          weight = relay.var("weight", shape=(3, 3, 64, 64))
  
          weight2 = relay.var("weight2", shape=(3, 3, 64, 64))
          weight2 = relay.layout_transform(weight2, "HWIO", "HWOI")
  
          y = relay.nn.conv2d(
              x,
              weight,
              channels=64,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="NHWC",
              kernel_layout="HWIO",
          )
          y = relay.nn.relu(y)
          y = relay.layout_transform(y, "NHWC", "HWNC")
  
          y2 = relay.nn.conv2d(
              y,
              weight2,
              channels=64,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="HWNC",
              kernel_layout="HWOI",
          )
          y2 = relay.nn.relu(y2)
  
          y2 = relay.layout_transform(y2, "HWNC", "NHWC")
          output = relay.Function(relay.analysis.free_vars(y2), y2)
          return output
  
      a = before()
      layout_config = relay.transform.LayoutConfig(skip_layers=[0])
      with layout_config:
          a = run_opt_pass(
              a,
              transform.ConvertLayout(
                  {"nn.conv2d": ["HWNC", "default"]}
              ),
          )
      b = run_opt_pass(expected(), transform.InferType())
      assert tvm.ir.structural_equal(a, b), "Actual = \n" + str(a)
  
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 37 for calling a global function with example usage: test_convert_with_config() and returns: out, output