class_docstr: Implements the Executor interface for AOT.
  
  Parameters
  ----------
  mod : :py:class:`~tvm.IRModule`
      The module to support the execution.
  
  device : :py:class:`Device`
      The runtime device to run the code on.
  
  target : any multi-target like object, see Target.canon_multi_target
      For homogeneous compilation, the unique build target.
      For heterogeneous compilation, a dictionary or list of possible build targets.
class_docstr_tok: ["Implements","the","Executor","interface","for","AOT",".","Parameters","--","--","--","--","--","mod",":",":","py",":","class",":","`","~tvm.IRModule","`","The","module","to","support","the","execution",".","device",":",":","py",":","class",":","`","Device","`","The","runtime","device","to","run","the","code","on",".","target",":","any","multi-target","like","object",",","see","Target.canon_multi_target","For","homogeneous","compilation",",","the","unique","build","target",".","For","heterogeneous","compilation",",","a","dictionary","or","list","of","possible","build","targets","."]
code: def _make_executor(self, expr=None):
      if expr:
          self.mod["main"] = expr
      self.mod = InferType()(self.mod)
      ret_type = self.mod["main"].checked_type.ret_type
      if _ty.is_dynamic(ret_type):
          raise ValueError(
              "AOT Executor only supports static graphs, got output type",
              ret_type,
          )
      mod = build(
          self.mod, target=self.target, executor=Executor("aot")
      )
  
      # NOTE: Given AOT requires use of the "c" backend, must export/import to compile the
      # generated code.
      temp_so_dir = contrib_utils.TempDirectory()
      temp_so = temp_so_dir / "temp.so"
      mod.export_library(temp_so, cc="gcc", options=["-std=c11"])
  
      mod = load_module(temp_so)
      aot_mod = mod["default"](self.device)
      gmodule = _aot_executor.AotModule(aot_mod)
  
      def _unflatten(flat_iter, cur_type):
          if isinstance(cur_type, _ty.TensorType):
              return next(flat_iter)
          if isinstance(cur_type, _ty.TupleType):
              fields = []
              for field_type in cur_type.fields:
                  field = _unflatten(flat_iter, field_type)
                  fields.append(field)
              return fields
          raise ValueError(
              "Return type",
              ret_type,
              "contains unsupported type",
              cur_type,
          )
  
      def _aot_wrapper(*args, **kwargs):
          args = self._convert_args(self.mod["main"], args, kwargs)
          # Create map of inputs.
          for i, arg in enumerate(args):
              gmodule.set_input(i, arg)
          # Run the module, and fetch the output.
          gmodule.run()
          flattened = []
          for i in range(gmodule.get_num_outputs()):
              flattened.append(gmodule.get_output(i).copyto(_nd.cpu(0)))
          unflattened = _unflatten(iter(flattened), ret_type)
          return unflattened
  
      return _aot_wrapper
  
imports: import warnings
  import numpy
  from tvm.ir import IRModule
  from tvm.target import Target
  from ..None import autotvm
  from ..None import nd
  from ..None import register_func
  from ..contrib import graph_executor
  from ..contrib import utils
  from ..runtime import load_module
  from ..runtime.executor import aot_executor
  from ..target import Target
  from .None import _build_module
  from .None import expr
  from .None import function
  from .None import ty
  from .backend import Executor, Runtime
  from .backend import executor_factory
  from .backend import interpreter
  from .backend.utils import mangle_module_name
  from .backend.vm import VMExecutor
  from .transform import InferType
label_desc: Use image node_id 2 for calling the AotExecutor obj's underlying member method code with example usage: obj._make_executor(expr) and returns: _aot_wrapper, unflattened, next, fields