code: def _compile_to_tvm(
      topology, executor, trace_input, target, ctx, config, extra_config
  ):
      import tvm
      from tvm import relay
      from tvm.contrib import graph_runtime
  
      ts_model = _jit_trace(executor, trace_input, "cpu", extra_config)
      test_input = [
          (
              topology.input_container.input_names[i],
              trace_input[i].shape
              if type(trace_input) is tuple
              else trace_input.shape,
          )
          for i in range(len(topology.input_container.input_names))
      ]
  
      model, params = relay.frontend.from_pytorch(ts_model, test_input)
  
      with tvm.transform.PassContext(opt_level=3, config=config):
          graph, lib, params = relay.build(
              model, target=target, params=params
          )
  
      tvm_model = graph_runtime.create(graph, lib, ctx)
      tvm_model.set_input(**params)
  
      extra_config[constants.TVM_GRAPH] = graph
      extra_config[constants.TVM_LIB] = lib
      extra_config[constants.TVM_PARAMS] = params
  
      return tvm_model
  
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 4 for calling a global function with example usage: _compile_to_tvm(topology, executor, trace_input, target, ctx, config, extra_config) and returns: tvm_model