class_docstr: Simple interpreter interface.
  
  Parameters
  ----------
  mod : tvm.IRModule
      The module to support the execution.
  
  device : Device
      The runtime device to run the code on.
  
  target : tvm.Target
      The target option to build the function. Only homogeneous execution is supported.
  
  CAUTION: Despite the API the module is prepared upon each call to evaluate
  rather than once in create_executor.
  That is:
  .. code-block:: python
  
      executor = relay.create_executor(kind="debug", mod=module)
      a = executor.evaluate(expr)(args1)
      b = executor.evaluate(expr)(args2)
  
  will prepare all the bindings in module twice. For efficiency, try to hoist
  calls to evaluate as high as possible, preferably immediately after create_executor:
  .. code-block:: python
  
      func = relay.create_executor(kind="debug", mod=module).evaluate(expr)
      a = func(args1)
      b = func(args2)
class_docstr_tok: ["Simple","interpreter","interface",".","Parameters","--","--","--","--","--","mod",":","tvm.IRModule","The","module","to","support","the","execution",".","device",":","Device","The","runtime","device","to","run","the","code","on",".","target",":","tvm.Target","The","target","option","to","build","the","function",".","Only","homogeneous","execution","is","supported",".","CAUTION",":","Despite","the","API","the","module","is","prepared","upon","each","call","to","evaluate","rather","than","once","in","create_executor",".","That","is",":","..","code-block",":",":","python","executor","=","relay.create_executor","(","kind=","''","debug","''",",","mod=module",")","a","=","executor.evaluate","(","expr",")","(","args1",")","b","=","executor.evaluate","(","expr",")","(","args2",")","will","prepare","all","the","bindings","in","module","twice",".","For","efficiency",",","try","to","hoist","calls","to","evaluate","as","high","as","possible",",","preferably","immediately","after","create_executor",":","..","code-block",":",":","python","func","=","relay.create_executor","(","kind=","''","debug","''",",","mod=module",")",".evaluate","(","expr",")","a","=","func","(","args1",")","b","=","func","(","args2",")"]
code: def _make_executor(self, expr=None):
      if expr is None or isinstance(expr, GlobalVar):
          assert self.mod is not None
  
      if expr is None:
          # A missing expr denotes 'main' in the given module.
          expr = self.mod.get_global_var("main")
  
      # Evaluate expr to a packed function we can efficiently re-apply
      # to Relay arguments.
      func = _backend.EvalFunction(
          self.mod, expr, self.device, self.target
      )
  
      def _apply_args(*args, **kwargs):
          if isinstance(expr, GlobalVar):
              # When expanding args, look inside the actual global definition so kwargs
              # can be matched.
              args = self._convert_args(
                  self.mod[expr.name_hint], args, kwargs
              )
          else:
              args = self._convert_args(expr, args, kwargs)
          # Reflect python arguments up into Relay.
          relay_args = []
          for arg in args:
              relay_args.append(_arg_to_ast(self.mod, arg))
          # Apply func to Relay args
          return func(relay_args)
  
      return _apply_args
  
imports: from __future__ import absolute_import
  import numpy
  import tvm._ffi
  from tvm.runtime import container, Object
  from .None import _backend
  from ..None import _make, analysis
  from ...None import nd
  from ..expr import Tuple, RefCreate, Call, Constant, GlobalVar, const
  from ..function import Function
  from ..scope_builder import ScopeBuilder
label_desc: Use image node_id 2 for calling the Interpreter obj's underlying member method code with example usage: obj._make_executor(expr) and returns: _apply_args, func