code: def _pre_execution(self, model, calib_dataloader=None, metric=None):
      if calib_dataloader:
  
          def numpy_collate_fn_wrapper(func):
              def transform_tensor_to_numpy(item):
                  if isinstance(item, torch.Tensor):
                      return item.numpy()
                  return item
  
              def collate_fn(batch):
                  res = func(batch)
                  return tuple(
                      map(lambda x: transform_tensor_to_numpy(x), res)
                  )
  
              return collate_fn
  
          # add a collate_fn to transform torch dataloader to a numpy dataloader
          calib_dataloader = deepcopy(calib_dataloader)
          calib_dataloader.collate_fn = numpy_collate_fn_wrapper(
              calib_dataloader.collate_fn
          )
  
      if isinstance(model, PytorchONNXRuntimeModel):
          self.nano_model = model
          model = model.onnx_model
      return model, calib_dataloader, metric
  
file_path: BigDL/python/nano/src/bigdl/nano/deps/neural_compressor/onnx/pytorch/quantization.py
imports: from copy import deepcopy
  from bigdl.nano.deps.onnxruntime.pytorch.pytorch_onnxruntime_model import PytorchONNXRuntimeModel
  from ..quantization import BaseONNXRuntimeQuantization
  from ...pytorch import PytorchQuantization
  from .metric import PytorchONNXRuntimeINCMetic
  import torch
label_desc: Use image node_id 2 for calling the PytorchONNXRuntimeQuantization obj's underlying member method code with example usage: obj._pre_execution(model, calib_dataloader, metric) and returns: model,  calib_dataloader,  metric, collate_fn, item, tuple, item