code: def collect_stats(model, data_loader, num_batches):
      """Feed data to the network and collect statistic"""
  
      # Enable calibrators
      for name, module in model.named_modules():
          if isinstance(module, quant_nn.TensorQuantizer):
              if module._calibrator is not None:
                  module.disable_quant()
                  module.enable_calib()
              else:
                  module.disable()
  
      for i, (images, _) in tqdm(
          enumerate(data_loader), total=num_batches
      ):
          model(images.cuda())
          if i >= num_batches:
              break
  
      # Disable calibrators
      for name, module in model.named_modules():
          if isinstance(module, quant_nn.TensorQuantizer):
              if module._calibrator is not None:
                  module.enable_quant()
                  module.disable_calib()
              else:
                  module.enable()
  
file_path: deep-learning-for-image-processing/deploying_service/deploying_pytorch/convert_tensorrt/convert_resnet34/quantization.py
imports: import os
  import math
  import argparse
  from absl import logging
  from tqdm import tqdm
  import torch
  import torch.optim
  import torch.optim.lr_scheduler
  from torchvision import transforms
  from torchvision.models.resnet import resnet34
  from pytorch_quantization import nn
  from pytorch_quantization import quant_modules, calib
  from pytorch_quantization.tensor_quant import QuantDescriptor
  from my_dataset import MyDataSet
  from utils import read_split_data, train_one_epoch, evaluate
label_desc: Use image node_id 2 for calling a global function with example usage: collect_stats(model, data_loader, num_batches) without return types