docstr: Parameters
  ----------
  training_data : numpy array
      The data using to calibrate quantization model
  cache_file : str
      The path user want to store calibrate cache file
  batch_size : int
      The batch_size of calibrating process
  algorithm : tensorrt.tensorrt.CalibrationAlgoType
      The algorithms of calibrating contains LEGACY_CALIBRATION,
      ENTROPY_CALIBRATION, ENTROPY_CALIBRATION_2, MINMAX_CALIBRATION.
      Please refer to https://docs.nvidia.com/deeplearning/tensorrt/api/
      python_api/infer/Int8/Calibrator.html for detail
code: def __init__(
      self,
      training_data,
      cache_file,
      batch_size=64,
      algorithm=trt.CalibrationAlgoType.ENTROPY_CALIBRATION_2,
  ):
      """
      Parameters
      ----------
      training_data : numpy array
          The data using to calibrate quantization model
      cache_file : str
          The path user want to store calibrate cache file
      batch_size : int
          The batch_size of calibrating process
      algorithm : tensorrt.tensorrt.CalibrationAlgoType
          The algorithms of calibrating contains LEGACY_CALIBRATION,
          ENTROPY_CALIBRATION, ENTROPY_CALIBRATION_2, MINMAX_CALIBRATION.
          Please refer to https://docs.nvidia.com/deeplearning/tensorrt/api/
          python_api/infer/Int8/Calibrator.html for detail
      """
      trt.IInt8Calibrator.__init__(self)
  
      self.algorithm = algorithm
      self.cache_file = cache_file
  
      self.data = training_data
      self.batch_size = batch_size
      self.current_index = 0
  
      # Allocate enough memory for a whole batch.
      self.device_input = cuda.mem_alloc(
          self.data[0].nbytes * self.batch_size
      )
  
file_path: nni/nni/compression/quantization_speedup/calibrator.py
imports: import os
  import logging
  import tensorrt
  import pycuda.driver
label_desc: Use image node_id 1 to create a new Calibrator object from inherited base classes: trt with example: obj = Calibrator(training_data, cache_file, batch_size, algorithm)