code: def run_module_via_rpc(
      rpc_config: "RPCConfig",
      lib: Union["Module", "Executable"],
      dev_type: str,
      args: Union[Dict[int, "np.ndarray"], Dict[str, "np.ndarray"]],
      continuation: Callable,
      backend: Optional[str] = "graph",
  ):
      """Execute a tvm.runtime.Module on RPC remote"""
      # pylint: disable=import-outside-toplevel
      import os
      import tempfile
  
      from tvm.contrib.tar import tar
      from tvm.runtime import ndarray
  
      # pylint: enable=import-outside-toplevel
  
      with tempfile.TemporaryDirectory() as tmp_dir:
          filename = os.path.join(
              tmp_dir, "tvm_tmp_mod." + tar.output_format
          )
          if backend == "vm":
              code, lib = lib.save()
          lib.export_library(filename, fcompile=tar)
          session = rpc_config.connect_server()
          session.upload(filename)
          _, filename = os.path.split(filename)
          rt_mod = session.load_module(filename)
          if backend == "vm":
              rt_mod = session.get_function("runtime.Load_Executable")(
                  code, rt_mod
              )
          dev = session.device(dev_type=dev_type, dev_id=0)
          nd_args = {k: ndarray.array(v, dev) for k, v in args.items()}
          return continuation(rt_mod, dev, nd_args)
  
imports: from typing import TYPE_CHECKING, Dict, List, Optional, Union, Callable
label_desc: Use image node_id 4 for calling a global function with example usage: run_module_via_rpc(rpc_config, lib, dev_type, args, continuation, backend) and returns: continuation