code: def test_qnn_conv_requantize_convert_layout():
      def before():
          x = relay.var("x", shape=(1, 56, 56, 64), dtype="int8")
          weight = relay.var(
              "weight", shape=(3, 3, 64, 64), dtype="int8"
          )
          y = relay.qnn.op.conv2d(
              x,
              weight,
              relay.const(1, "int32"),
              relay.const(1, "int32"),
              relay.const(1, "float32"),
              relay.const(1, "float32"),
              channels=64,
              kernel_size=(3, 3),
              padding=(1, 1),
              data_layout="NHWC",
              kernel_layout="HWIO",
          )
          y = relay.qnn.op.requantize(
              y,
              relay.const(1, "float32"),
              relay.const(1, "int32"),
              relay.const(1, "float32"),
              relay.const(1, "int32"),
              out_dtype="int32",
          )
          y = relay.nn.relu(y)
          y = relay.Function([x, weight], y)
          return y
  
      def expected():
          x = relay.var("x", shape=(1, 56, 56, 64), dtype="int8")
          weight = relay.var(
              "weight", shape=(3, 3, 64, 64), dtype="int8"
          )
          x = relay.layout_transform(x, "NHWC", "NCHW")
          weight = relay.layout_transform(weight, "HWIO", "OIHW")
          y = relay.qnn.op.conv2d(
              x,
              weight,
              relay.const(1, "int32"),
              relay.const(1, "int32"),
              relay.const(1, "float32"),
              relay.const(1, "float32"),
              channels=64,
              kernel_size=(3, 3),
              padding=(1, 1),
          )
          y = relay.qnn.op.requantize(
              y,
              relay.const(1, "float32"),
              relay.const(1, "int32"),
              relay.const(1, "float32"),
              relay.const(1, "int32"),
              axis=1,
              out_dtype="int32",
          )
          y = relay.nn.relu(y)
          y = relay.layout_transform(y, "NCHW", "NHWC")
          y = relay.Function(relay.analysis.free_vars(y), y)
          return y
  
      a = before()
      a = run_opt_pass(
          a,
          transform.ConvertLayout({"qnn.conv2d": ["NCHW", "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 22 for calling a global function with example usage: test_qnn_conv_requantize_convert_layout() and returns: y, y