code: def calibrate(
      model, train_loader, logger, calib_iter=1, percentile=99.99
  ):
      """Calibrates whole network i.e. gathers data for quantization and calculates quantization parameters"""
      model.eval()
  
      with torch.no_grad():
          collect_stats(
              model, train_loader, logger, num_batches=calib_iter
          )
          compute_amax(
              model, method="percentile", percentile=percentile
          )
  
      logging.disable(logging.NOTSET)
  
file_path: DALI/docs/examples/use_cases/pytorch/efficientnet/image_classification/quantization.py
imports: from tqdm import tqdm
  import torch
  import contextlib
  import time
  import logging
  from pytorch_quantization import quant_modules
  from pytorch_quantization import nn
  from pytorch_quantization import calib
  from pytorch_quantization.tensor_quant import QuantDescriptor
  from .None import logger
  from .utils import calc_ips
  import dllogger
label_desc: Use image node_id 6 for calling a global function with example usage: calibrate(model, train_loader, logger, calib_iter, percentile) without return types