code: def test_fold_requantize():
      def before():
          data = tvm.nd.array(np.array([1, 2, 3], dtype="int8"))
          const_i8 = relay.const(data, dtype="int8")
          op = relay.qnn.op.requantize(
              const_i8,
              input_scale=relay.const(2.0, dtype="float32"),
              input_zero_point=relay.const(1, dtype="int32"),
              output_scale=relay.const(1.0, dtype="float32"),
              output_zero_point=relay.const(1, dtype="int32"),
          )
          x = relay.var("x", relay.TensorType([3], "int8"))
          add = relay.op.add(op, x)
          func = relay.Function([x], add)
          return func
  
      def expected():
          data = tvm.nd.array(np.array([1, 3, 5], dtype="int8"))
          const_i8 = relay.const(data, dtype="int8")
          x = relay.var("x", relay.TensorType([3], "int8"))
          add = relay.op.add(const_i8, x)
          func = relay.Function([x], add)
          return func
  
      # Nothing changed after applying FoldConstant
      a = run_opt_pass(before(), transform.FoldConstant())
      b = run_opt_pass(before(), transform.InferType())
      tvm.ir.assert_structural_equal(a, b)
  
      # Fold QNN constants
      a = run_opt_pass(before(), transform.FoldConstant(fold_qnn=True))
      b = run_opt_pass(expected(), transform.InferType())
      tvm.ir.assert_structural_equal(a, b)
  
imports: import numpy
  import tvm
  import tvm.testing
  from tvm import relay
  from tvm.relay.backend import Executor
  from tvm.relay import transform
  from tvm.relay.build_module import bind_params_by_name
  from tvm.relay.testing import run_infer_type, create_workload
label_desc: Use image node_id 18 for calling a global function with example usage: test_fold_requantize() and returns: func, func