code: def benchmark_int8(
      quantize_mode, quantize_granularity, elemwise_add, broadcast=False
  ):
      header = (
          operator_string(elemwise_add)
          + ", mode = "
          + quantize_mode
          + ", granularity = "
          + quantize_granularity
          + (" , broadcast" if broadcast else "")
      )
      print_header(header)
      for shape, nhid in sizes:
          net = FCWithSum(shape[1], nhid, elemwise_add)
          net.initialize()
          net.hybridize(static_alloc=True, static_shape=True)
          data0 = mx.np.random.uniform(size=shape, low=-1.0, high=1.0)
          data1 = mx.np.random.uniform(size=shape, low=-1.0, high=1.0)
          shape2 = (shape[0], nhid)
          if broadcast and not elemwise_add:
              # broadcast is allowed only for npi_add
              shape2 = (shape[0], 1)
          data2 = mx.np.random.uniform(size=shape2, low=-1.0, high=1.0)
          data = mx.gluon.data.ArrayDataset(data0, data1, data2)
          calib_data = mx.gluon.data.DataLoader(data, batch_size=1)
          net = quantization.quantize_net(
              net,
              device=mx.cpu(),
              exclude_layers=None,
              exclude_operators=None,
              calib_mode="naive",
              calib_data=calib_data,
              num_calib_batches=1,
              quantize_mode=quantize_mode,
              quantize_granularity=quantize_granularity,
          )
          net.hybridize(static_alloc=True, static_shape=True)
          measure(net, data0, data1, data2, shape, nhid)
      dump_graph_fn(
          net,
          operator_string(elemwise_add)
          + "_"
          + str(quantize_mode)
          + "_"
          + str(quantize_granularity),
      )
  
imports: import time
  import gc
  import sys
  import mxnet
  from mxnet.gluon import nn
  from mxnet.contrib import quantization
label_desc: Use image node_id 7 for calling a global function with example usage: benchmark_int8(quantize_mode, quantize_granularity, elemwise_add, broadcast) without return types