code: def test_quantize_sym_with_calib():
      if is_test_for_native_cpu():
          print(
              "skipped testing quantized_pooling for native cpu since it is not supported yet"
          )
          return
  
      def get_fp32_sym():
          data = mx.sym.Variable("data")
          conv = mx.sym.Convolution(
              data, kernel=(1, 1), num_filter=16, name="conv"
          )
          bn = mx.sym.BatchNorm(
              data=conv,
              eps=2e-05,
              fix_gamma=False,
              momentum=0.9,
              use_global_stats=False,
              name="bn",
          )
          act = mx.sym.Activation(data=bn, act_type="relu", name="relu")
          pool = mx.sym.Pooling(
              act, kernel=(4, 4), pool_type="avg", name="pool"
          )
          fc = mx.sym.FullyConnected(
              pool, num_hidden=10, flatten=True, name="fc"
          )
          sym = mx.sym.softmax(fc, name="softmax")
          return sym
  
      sym = get_fp32_sym()
      offline_params = [
          name
          for name in sym.list_arguments()
          if not name.startswith("data") and not name.endswith("label")
      ]
      qsym, _ = mx.contrib.quant._quantize_symbol(
          sym,
          device=mx.current_device(),
          offline_params=offline_params,
          quantize_mode="full",
      )
      requantize_op_names = ["requantize_conv", "requantize_fc"]
      min_max_dict = {
          "conv_output": (
              onp.random.uniform(low=100.0, high=200.0),
              onp.random.uniform(low=100.0, high=200.0),
          ),
          "fc_output": (
              onp.random.uniform(low=100.0, high=200.0),
              onp.random.uniform(low=100.0, high=200.0),
          ),
      }
      op_name_to_th_name = {
          "requantize_conv": "conv_output",
          "requantize_fc": "fc_output",
      }
      cqsym = mx.contrib.quant._calibrate_quantized_sym(
          qsym, min_max_dict
      )
      attr_dict = cqsym.attr_dict()
      for name in requantize_op_names:
          assert name in attr_dict
          lhs = float(attr_dict[name]["min_calib_range"])
          rhs = min_max_dict[op_name_to_th_name[name]][0]
          assert_almost_equal(onp.array([lhs]), onp.array([rhs]))
          lhs = float(attr_dict[name]["max_calib_range"])
          rhs = min_max_dict[op_name_to_th_name[name]][1]
          assert_almost_equal(
              onp.array([lhs]), onp.array([rhs]), rtol=1e-3, atol=1e-4
          )
  
imports: import os
  import mxnet
  import numpy
  from mxnet import npx
  from mxnet.util import use_np
  from mxnet.gluon.model_zoo import vision
  from mxnet.test_utils import assert_almost_equal, assert_exception, rand_ndarray, rand_shape_nd, same, DummyIter
  from common import xfail_when_nonstandard_decimal_separator
  from mxnet.io import NDArrayIter
  import unittest
  import operator
label_desc: Use image node_id 25 for calling a global function with example usage: test_quantize_sym_with_calib() and returns: sym