code: def _test_tvm_export(model, img, target="llvm"):
      model = model.eval()
  
      # We grab the TorchScripted model via tracing
      input_shape = [1, 3, 224, 224]
      input_data = torch.randn(input_shape)
      scripted_model = torch.jit.trace(model, input_data).eval()
      input_name = "input0"
      shape_list = [(input_name, img.shape)]
      mod, params = relay.frontend.from_pytorch(
          scripted_model, shape_list
      )
      if target == "llvm":
          ctx = tvm.cpu(0)
      elif target == "cuda":
          ctx = tvm.gpu(0)
      else:
          raise ValueError(target)
      target_host = "llvm"
  
      with tvm.transform.PassContext(opt_level=3):
          lib = relay.build(
              mod, target=target, target_host=target_host, params=params
          )
  
      dtype = "float32"
      m = graph_executor.GraphModule(lib["default"](ctx))
      # Set inputs
      m.set_input(input_name, tvm.nd.array(img.astype(dtype)))
      # Execute
      m.run()
      # Get outputs
      tvm_output = m.get_output(0)
  
file_path: gluon-cv/tests/model_zoo_torch/test_tvm_torch_export.py
imports: import tvm
  from tvm import relay
  from tvm.contrib import graph_executor
  from PIL import Image
  import numpy
  import torch
  import torchvision.transforms
  import torchvision
  from torchvision import transforms
  from gluoncv.torch.engine.config import get_cfg_defaults
  from gluoncv.torch import model_zoo
label_desc: Use image node_id 1 for calling a global function with example usage: _test_tvm_export(model, img, target) without return types