class_docstr: Hexagon Device Session
  
  Parameters
  ----------
  remote_workspace : Union[str, pathlib.Path]
      Remote workspace path
  
  rpc_tracker : tuple(str, int)
      RPC tracker host and port number.
  
  rpc_server_key : str
      RPC server key on remote device.
  
  serial_number : str
      Device serial number. `simulator` used for hexagon simulator.
  
  session_name : str
      Hexagon RPC session name.
  
  remote_stack_size_bytes : int
      The stack size of the remote device, to be passed to
      tvm.contrib.hexagon.create_hexagon_session.
  
  rpc_receive_buffer_size_bytes : int
      RPC receive buffer size in bytes.
class_docstr_tok: ["Hexagon","Device","Session","Parameters","--","--","--","--","--","remote_workspace",":","Union","[","str",",","pathlib.Path","]","Remote","workspace","path","rpc_tracker",":","tuple","(","str",",","int",")","RPC","tracker","host","and","port","number",".","rpc_server_key",":","str","RPC","server","key","on","remote","device",".","serial_number",":","str","Device","serial","number",".","`","simulator","`","used","for","hexagon","simulator",".","session_name",":","str","Hexagon","RPC","session","name",".","remote_stack_size_bytes",":","int","The","stack","size","of","the","remote","device",",","to","be","passed","to","tvm.contrib.hexagon.create_hexagon_session",".","rpc_receive_buffer_size_bytes",":","int","RPC","receive","buffer","size","in","bytes","."]
docstr: Load TVM module.
  
  The session must be established (via __enter__) prior to
  calling this function.
  
  Parameters
  ----------
  module : Union[str, pathlib.Path, tvm.runtime.Module]
  
      The module to load.  If `module` is a
      `tvm.runtime.Module`, it will be uploaded to the remote
      session and loaded.
  
      If the object passed is a string or pathlib.Path, it must
      be a full path in the remote system.
  
  Returns
  -------
  TVMModule :
      TVM module object.
docstr_tok: ["Load","TVM","module",".","The","session","must","be","established","(","via","__enter__",")","prior","to","calling","this","function",".","Parameters","--","--","--","--","--","module",":","Union","[","str",",","pathlib.Path",",","tvm.runtime.Module","]","The","module","to","load",".","If","`","module","`","is","a","`","tvm.runtime.Module","`",",","it","will","be","uploaded","to","the","remote","session","and","loaded",".","If","the","object","passed","is","a","string","or","pathlib.Path",",","it","must","be","a","full","path","in","the","remote","system",".","Returns","--","--","--","-","TVMModule",":","TVM","module","object","."]
code: def load_module(
      self, module: Union[str, pathlib.Path, tvm.runtime.Module]
  ):
      """Load TVM module.
  
      The session must be established (via __enter__) prior to
      calling this function.
  
      Parameters
      ----------
      module : Union[str, pathlib.Path, tvm.runtime.Module]
  
          The module to load.  If `module` is a
          `tvm.runtime.Module`, it will be uploaded to the remote
          session and loaded.
  
          If the object passed is a string or pathlib.Path, it must
          be a full path in the remote system.
  
      Returns
      -------
      TVMModule :
          TVM module object.
      """
  
      assert (
          self._rpc is not None
      ), "Hexagon session must be started using __enter__ prior to use"
  
      if isinstance(module, tvm.runtime.Module):
          with tempfile.TemporaryDirectory() as temp_dir:
              binary_name = "test_binary.so"
              binary_path = export_module(module, temp_dir, binary_name)
              remote_file_path = self.upload(binary_path, binary_name)
      else:
          remote_file_path = module
  
      assert isinstance(
          remote_file_path, (str, pathlib.Path)
      ), "Invalid path type:" + str(type(remote_file_path))
      return self._rpc.get_function("tvm.hexagon.load_module")(
          str(remote_file_path)
      )
  
imports: import os
  import pathlib
  import tempfile
  from typing import Union
  import tvm
  from tvm import rpc
  import tvm.contrib.hexagon
  from tvm.relay.backend.executor_factory import ExecutorFactoryModule, AOTExecutorFactoryModule, GraphExecutorFactoryModule
  from .tools import export_module, HEXAGON_SIMULATOR_NAME
label_desc: Use image node_id 8 for calling the Session obj's underlying member method code with example usage: obj.load_module(module) and returns: self