code: def _jit_trace(executor, trace_input, device, extra_config):
      """
      Function used to convert an input pytorch model into torchscript.
      """
      if device != "cpu":
          if type(trace_input) is tuple:
              for input_ in trace_input:
                  input_.to(device)
          else:
              trace_input.to(device)
      return torch.jit.trace(executor, trace_input).eval()
  
imports: import numpy
  import os
  from packaging.version import Version, parse
  import torch
  from uuid import uuid4
  from onnxconverter_common.registration import get_converter
  from onnxconverter_common.topology import Topology
  import onnx
  from hummingbird.ml.containers import PyTorchSklearnContainerRegression, PyTorchSklearnContainerClassification, PyTorchSklearnContainerTransformer, PyTorchSklearnContainerAnomalyDetection, TorchScriptSklearnContainerRegression, TorchScriptSklearnContainerClassification, TorchScriptSklearnContainerTransformer, TorchScriptSklearnContainerAnomalyDetection, ONNXSklearnContainerRegression, ONNXSklearnContainerClassification, ONNXSklearnContainerTransformer, ONNXSklearnContainerAnomalyDetection, TVMSklearnContainerRegression, TVMSklearnContainerClassification, TVMSklearnContainerTransformer, TVMSklearnContainerAnomalyDetection, BatchContainer
  from hummingbird.ml._utils import pandas_installed, tvm_installed, get_device, from_strings_to_ints
  from hummingbird.ml._executor import Executor
  from hummingbird.ml.exceptions import MissingConverter
  from hummingbird.ml.operator_converters import constants
label_desc: Use image node_id 1 for calling a global function with example usage: _jit_trace(executor, trace_input, device, extra_config) and returns: torch