code: def get_ref_func(
      data,
      kernel,
      input_zero_point,
      kernel_zero_point,
      input_scale,
      kernel_scale,
      kernel_size,
      padding,
      strides,
      dilation,
      data_layout,
      kernel_layout,
      out_dtype,
      groups,
      channels=None,
  ):
      if isinstance(input_zero_point, (int, float)):
          input_zero_point = relay.const(input_zero_point, "int32")
      if isinstance(kernel_zero_point, (int, float)):
          kernel_zero_point = relay.const(kernel_zero_point, "int32")
      else:
          # Kernel zero point expression requires manual broadcasting for some layouts.
          if kernel_layout == "OIHW":
              kernel_zero_point = relay.reshape(
                  kernel_zero_point, [-1, 1, 1, 1]
              )
          elif kernel_layout == "HWOI":
              kernel_zero_point = relay.reshape(
                  kernel_zero_point, [1, 1, -1, 1]
              )
  
      casted_data = relay.op.cast(data, "int32")
      casted_kernel = relay.op.cast(kernel, "int32")
      shifted_data = relay.op.subtract(casted_data, input_zero_point)
      shifted_kernel = relay.op.subtract(
          casted_kernel, kernel_zero_point
      )
      func = relay.op.nn.conv2d(
          shifted_data,
          shifted_kernel,
          padding=padding,
          strides=strides,
          dilation=dilation,
          groups=groups,
          channels=channels,
          kernel_size=kernel_size,
          out_dtype=out_dtype,
          data_layout=data_layout,
          kernel_layout=kernel_layout,
      )
  
      func = relay.Function(relay.analysis.free_vars(func), func)
      return func
  
imports: import tvm
  from tvm import te
  import numpy
  from tvm import relay
  from tvm.relay import transform
  from tvm.relay.testing import run_infer_type
  from tvm.contrib import graph_executor
  from tvm.relay.testing.temp_op_attr import TempOpAttr
label_desc: Use image node_id 2 for calling a global function with example usage: get_ref_func(data, kernel, input_zero_point, kernel_zero_point, input_scale, kernel_scale, kernel_size, padding, strides, dilation, data_layout, kernel_layout, out_dtype, groups, channels) and returns: func