code: def make_test_conv_depthwise_conv():
      """Generates a convolution -> depthwise_convolution -> convolution pattern that can have
      channels stripped. The structure here mirrors MobileNetV1's layers 8-10.
      """
  
      input_var = relay.var("input", shape=(1, 12, 12, 4), dtype="int8")
  
      kernel_1 = np.array(
          [[0, 1, 0, -2], [0, 3, 0, 5], [0, 5, 0, -9], [0, 2, 0, 21]],
          dtype="int8",
      ).reshape((1, 1, 4, 4))
      input_scale_1 = np.float32(0.5)
      output_scale_1 = np.array([0.5, 2.0, 0.25, 4.0], dtype="float32")
  
      out = relay.qnn.conv2d(
          input_var,
          tvm_const(kernel_1),
          tvm_const(np.int32(-128)),
          tvm_const(np.int32(0)),
          tvm_const(input_scale_1),
          tvm_const(output_scale_1),
          channels=4,
          kernel_size=(1, 1),
          padding=(0, 0),
          data_layout="NHWC",
          kernel_layout="HWIO",
      )
  
      bias_1 = np.array([198, -2, 19, 10], dtype="int32")
      out = relay.nn.bias_add(
          out,
          tvm_const(bias_1),
          axis=3,
      )
  
      input_scale_2 = np.float32(0.25)
      out = relay.qnn.requantize(
          out,
          tvm_const(input_scale_1 * output_scale_1),
          tvm_const(np.int32(0)),
          tvm_const(input_scale_2),
          tvm_const(np.int32(-128)),
          axis=3,
          out_dtype="int8",
      )
      # Outputs here will be fixed to {0: 70, 2: -118}
  
      kernel_2 = np.array(
          [
              [0, 6, 4, 2],
              [8, 6, -3, -1],
              [-2, -5, 3, -8],
              [-7, 5, 1, 9],
              [-4, -9, -8, -2],
              [-1, 4, -5, 3],
              [-4, -9, 2, 6],
              [9, -6, 0, 5],
              [-3, 8, 1, -7],
          ],
          dtype="int8",
      ).reshape((3, 3, 4, 1))
      output_scale_2 = np.array(
          [0.25, 0.125, 2.0, 0.125], dtype="float32"
      )
      out = relay.qnn.conv2d(
          out,
          tvm_const(kernel_2),
          tvm_const(np.int32(-128)),
          tvm_const(np.int32(0)),
          tvm_const(input_scale_2),
          tvm_const(output_scale_2),
          channels=4,
          groups=4,
          kernel_size=(3, 3),
          padding=(1, 1),
          data_layout="NHWC",
          kernel_layout="HWOI",
      )
  
      bias_2 = np.array([4582, 4, -12, 15], dtype="int32")
      out = relay.nn.bias_add(
          out,
          tvm_const(bias_2),
          axis=3,
      )
  
      input_scale_3 = np.float32(0.125)
      out = relay.qnn.requantize(
          out,
          tvm_const(input_scale_2 * output_scale_2),
          tvm_const(np.int32(0)),
          tvm_const(input_scale_3),
          tvm_const(np.int32(-128)),
          axis=3,
          out_dtype="int8",
      )
      # Outputs here will be fixed to {0: 127, 2: -128}
  
      kernel_3 = np.array(
          [[4, -2, 9, 9], [0, 0, 0, 0], [0, 0, 0, 0], [-1, 1, -1, 1]],
          dtype="int8",
      ).reshape((1, 1, 4, 4))
      output_scale_3 = np.array(
          [0.25, 0.125, 1.0, 0.5], dtype="float32"
      )
  
      out = relay.qnn.conv2d(
          out,
          tvm_const(kernel_3),
          tvm_const(np.int32(-128)),
          tvm_const(np.int32(0)),
          tvm_const(input_scale_3),
          tvm_const(output_scale_3),
          channels=4,
          kernel_size=(1, 1),
          padding=(0, 0),
          data_layout="NHWC",
          kernel_layout="HWIO",
      )
  
      bias_3 = np.array([1, -1, 4, 6], dtype="int32")
      out = relay.nn.bias_add(
          out,
          tvm_const(bias_3),
          axis=3,
      )
  
      return relay.Function([input_var], out)
  
file_path: tvm/tests/python/relay/qnn/test_qnn_channel_stripping.py
imports: import numpy
  import tvm
  from tvm import nd, relay
  from tvm.relay import transform
  from tvm.relay.testing.temp_op_attr import TempOpAttr
  from tvm.testing.aot import generate_ref_data
  from tvm.topi.arm_cpu.qnn_legalize import legalize_bias_add
label_desc: Use image node_id 4 for calling a global function with example usage: make_test_conv_depthwise_conv() and returns: relay