code: def as_torch(
      func: Union[
          tvm.ir.module.IRModule, tvm.tir.function.PrimFunc, Callable
      ]
  ):
      """A decorator of converting TensorIR to PyTorch nn.Module.
  
      Parameters
      ----------
      func: Optional[tvm.ir.module.IRModule, tvm.tir.function.PrimFunc, Callable]
          The function written by TVMScript.
  
      Returns
      -------
      mod : Union[OperatorModuleWrapper, Callable]
          It will return an object, or a templated function of OperatorModuleWrapper,
          which is the subclass of the original nn.Module.
  
      """
      if isinstance(func, (tvm.ir.module.IRModule, PrimFunc)):
          return OperatorModuleWrapper(func)
      if callable(func):
  
          def func_get_param(*args, **kwargs):
              return OperatorModuleWrapper(func(*args, **kwargs))
  
          return func_get_param
  
file_path: tvm/python/tvm/contrib/torch/as_torch.py
imports: import tempfile
  from typing import Callable, List, Optional, Union
  from typing_extensions import Literal
  import torch
  import torch.utils.dlpack
  import tvm
  from tvm import meta_schedule
  from tvm.target.target import Target
  from tvm.tir import PrimFunc
label_desc: Use image node_id 1 for calling a global function with example usage: as_torch(func) and returns: OperatorModuleWrapper, func_get_param, OperatorModuleWrapper