code: def evaluate_network(network, target, target_host, repeat):
      # connect to remote device
      tracker = tvm.rpc.connect_tracker(args.host, args.port)
      remote = tracker.request(args.rpc_key)
  
      print_progress(network)
      net, params, input_shape, output_shape = get_network(
          network, batch_size=1
      )
  
      print_progress("%-20s building..." % network)
      with tvm.transform.PassContext(opt_level=3):
          lib = relay.build(
              net,
              target=tvm.target.Target(target, host=target_host),
              params=params,
          )
  
      tmp = tempdir()
      if "android" in str(target):
          from tvm.contrib import ndk
  
          filename = "%s.so" % network
          lib.export_library(
              tmp.relpath(filename), fcompile=ndk.create_shared
          )
      else:
          filename = "%s.tar" % network
          lib.export_library(tmp.relpath(filename))
  
      # upload library and params
      print_progress("%-20s uploading..." % network)
      dev = remote.device(str(target), 0)
      remote.upload(tmp.relpath(filename))
  
      rlib = remote.load_module(filename)
      module = runtime.GraphModule(rlib["default"](dev))
      data_tvm = tvm.nd.array(
          (np.random.uniform(size=input_shape)).astype(dtype)
      )
      module.set_input("data", data_tvm)
  
      # evaluate
      print_progress("%-20s evaluating..." % network)
      ftimer = module.module.time_evaluator(
          "run", dev, number=1, repeat=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/arm_cpu_imagenet_bench.py
imports: import argparse
  import numpy
  import tvm
  from tvm import te
  from tvm.contrib.utils import tempdir
  import tvm.contrib.graph_executor
  from tvm import relay
  from util import get_network, print_progress
label_desc: Use image node_id 1 for calling a global function with example usage: evaluate_network(network, target, target_host, repeat) without return types