code: def run_torch_model(
      torch_model: torch.nn.Module,
      input_tensors: List[torch.Tensor],
      device: Device,
      dtype: torch.dtype = torch.float,
  ) -> List[torch.Tensor]:
      torch_model.eval()
      if device.type is DeviceType.GPU:
          torch_model.to(device.to_torch_format())
          if dtype != torch.half:
              input_tensors = (
                  t.to(device.to_torch_format()) for t in input_tensors
              )
          else:
              input_tensors = (
                  t.to(device.to_torch_format()).half()
                  if t.dtype == torch.float
                  else t.to(device.to_torch_format())
                  for t in input_tensors
              )
      with torch.no_grad():
          pred = torch_model(*input_tensors)
      if isinstance(pred, torch.Tensor):
          pred = [pred.cpu()]
      else:
          pred = [p.cpu() for p in pred]
      return pred
  
file_path: nebuly/optimization/nebullvm/nebullvm/tools/pytorch.py
imports: from pathlib import Path
  from typing import List, Tuple, Optional, Dict, Union, Sequence
  from loguru import logger
  from nebullvm.core.models import Device, DataType, DeviceType, InputInfo
  from nebullvm.optional_modules.torch import torch, DataLoader
  from nebullvm.tools.data import DataManager
  from nebullvm.tools.diffusers import get_default_dynamic_info
label_desc: Use image node_id 5 for calling a global function with example usage: run_torch_model(torch_model, input_tensors, device, dtype) and returns: pred