code: def _quantize(
      mod: IRModule,
      params: Dict[str, NDArray],
      input_data: TVMCalibrator = None,
  ) -> IRModule:
      if input_data is not None:
          with relay.quantize.qconfig(
              calibrate_mode="kl_divergence", weight_scale="max"
          ):
              mod = relay.quantize.quantize(
                  mod, params, dataset=input_data
              )
      else:
          with relay.quantize.qconfig(
              calibrate_mode="global_scale", global_scale=8.0
          ):
              mod = relay.quantize.quantize(mod, params)
      return mod
  
imports: import abc
  import os
  import uuid
  from abc import ABC
  from typing import Any, Tuple, Dict, Union
  from nebullvm.config import AUTO_TVM_PARAMS, AUTO_TVM_TUNING_OPTION
  from nebullvm.core.models import QuantizationType, ModelParams, DeviceType, Device
  from nebullvm.operations.optimizations.compilers.base import Compiler
  from nebullvm.operations.optimizations.compilers.quantizations.tvm import TVMCalibrator, quantize_apache_tvm
  from nebullvm.operations.optimizations.compilers.quantizations.utils import check_quantization
  from nebullvm.optional_modules.onnx import onnx
  from nebullvm.optional_modules.torch import Module, torch
  from nebullvm.optional_modules.tvm import tvm, IRModule, NDArray, XGBTuner, autotvm, relay, ExecutorFactoryModule
  from nebullvm.tools.data import DataManager
  from nebullvm.tools.onnx import get_input_names
  from nebullvm.tools.pytorch import create_model_inputs_torch
  from nebullvm.tools.transformations import MultiStageTransformation
label_desc: Use image node_id 6 for calling the ApacheTVMCompiler obj's underlying member method code with example usage: obj._quantize(mod, params, input_data) and returns: mod