code: def benchmark(network, target):
      net, params, input_shape, output_shape = get_network(
          network, batch_size=1
      )
  
      with tvm.transform.PassContext(opt_level=3):
          lib = relay.build(net, target=target, params=params)
  
      # create runtime
      dev = tvm.device(str(target), 0)
      module = runtime.GraphModule(lib["default"](dev))
      data_tvm = tvm.nd.array(
          (np.random.uniform(size=input_shape)).astype(dtype)
      )
      module.set_input("data", data_tvm)
  
      # evaluate
      ftimer = module.module.time_evaluator(
          "run", dev, number=1, repeat=args.repeat
      )
      prof_res = (
          np.array(ftimer().results) * 1000
      )  # multiply 1000 for converting to millisecond
      print(
          "%-20s %-19s (%s)"
          % (
              network,
              "%.2f ms" % np.mean(prof_res),
              "%.2f ms" % np.std(prof_res),
          )
      )
  
file_path: tvm/apps/benchmark/gpu_imagenet_bench.py
imports: import argparse
  import threading
  import numpy
  import tvm
  from tvm import te
  import tvm.contrib.graph_executor
  from tvm import relay
  from util import get_network
label_desc: Use image node_id 1 for calling a global function with example usage: benchmark(network, target) without return types