code: def _build_tvm_model_from_torch(
      torch_model: Module, model_params: ModelParams, device: Device
  ) -> Tuple[IRModule, Dict[str, NDArray]]:
      shape_dict = {
          f"input_{i}": input_size
          for i, input_size in enumerate(model_params.input_sizes)
      }
      inputs = tuple(
          create_model_inputs_torch(model_params.input_infos)
      )
      if device.type is not DeviceType.GPU:
          inputs = tuple(input_.cpu() for input_ in inputs)
          torch_model.cpu()
      else:
          inputs = tuple(
              input_.to(device.to_torch_format()) for input_ in inputs
          )
          torch_model.to(device.to_torch_format())
      with torch.no_grad():
          _ = torch_model(*inputs)
          model_trace = torch.jit.trace(torch_model, inputs)
          model_trace.eval()
      mod, params = relay.frontend.from_pytorch(
          model_trace, list(shape_dict.items())
      )
      return mod, params
  
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 4 for calling the ApacheTVMCompiler obj's underlying member method code with example usage: obj._build_tvm_model_from_torch(torch_model, model_params, device) and returns: mod,  params