code: def test_plugin_module():
      curr_path = os.path.dirname(
          os.path.abspath(os.path.expanduser(__file__))
      )
      mod = tvm.runtime.load_module(
          os.path.join(curr_path, "lib", "plugin_module.so")
      )
  
      # NOTE: we need to make sure all managed resources returned
      # from mod get destructed before mod get unloaded.
      #
      # Failure mode we want to prevent from:
      # We retain an object X whose destructor is within mod.
      # The program will segfault if X get destructed after mod,
      # because the destructor function has already been unloaded.
      #
      # The easiest way to achieve this is to wrap the
      # logics related to mod inside a function.
      def run_module(mod):
          # normal functions
          assert mod["AddOne"](10) == 11
          assert mod["SubOne"](10) == 9
          # advanced usecase: return a module
          mymod = mod["CreateMyModule"](10)
          fadd = mymod["add"]
          assert fadd(10) == 20
          assert mymod["mul"](10) == 100
  
      run_module(mod)
  
imports: import tvm
  from tvm import te
  import os
label_desc: Use image node_id 1 for calling a global function with example usage: test_plugin_module() without return types