class_docstr: An Interpreter executes an FX graph Node-by-Node. This pattern
  can be useful for many things, including writing code
  transformations as well as analysis passes.
  
  Methods in the Interpreter class can be overridden to customize
  the behavior of execution. The map of overrideable methods
  in terms of call hierarchy::
  
      run()
          +-- run_node
              +-- placeholder()
              +-- get_attr()
              +-- call_function()
              +-- call_method()
              +-- call_module()
              +-- output()
  
  Example:
  
      Suppose we want to swap all instances of ``torch.neg`` with
      ``torch.sigmoid`` and vice versa (including their ``Tensor``
      method equivalents). We could subclass Interpreter like so::
  
          class NegSigmSwapInterpreter(Interpreter):
              def call_function(self, target : Target,
                                args : Tuple, kwargs : Dict) -> Any:
                  if target == torch.sigmoid:
                      return torch.neg(*args, **kwargs)
                  return super().call_function(n)
  
              def call_method(self, target : Target,
                              args : Tuple, kwargs : Dict) -> Any:
                  if target == 'neg':
                      call_self, *args_tail = args
                      return call_self.sigmoid(*args_tail, **kwargs)
                  return super().call_method(n)
  
          def fn(x):
              return torch.sigmoid(x).neg()
  
          gm = torch.fx.symbolic_trace(fn)
          input = torch.randn(3, 4)
          result = NegSigmSwapInterpreter(gm).run(input)
          torch.testing.assert_close(result, torch.neg(input).sigmoid())
  
  Args:
      module (torch.nn.Module): The module to be executed
      garbage_collect_values (bool): Whether to delete values after their last
          use within the Module's execution. This ensures optimal memory usage during
          execution. This can be disabled to, for example, examine all of the intermediate
          values in the execution by looking at the ``Interpreter.env`` attribute.
      graph (Optional[Graph]): If passed, the interpreter will execute this
          graph instead of `module.graph`, using the provided `module`
          argument to satisfy any requests for state.
class_docstr_tok: ["An","Interpreter","executes","an","FX","graph","Node-by-Node",".","This","pattern","can","be","useful","for","many","things",",","including","writing","code","transformations","as","well","as","analysis","passes",".","Methods","in","the","Interpreter","class","can","be","overridden","to","customize","the","behavior","of","execution",".","The","map","of","overrideable","methods","in","terms","of","call","hierarchy",":",":","run","(",")","+","--","run_node","+","--","placeholder","(",")","+","--","get_attr","(",")","+","--","call_function","(",")","+","--","call_method","(",")","+","--","call_module","(",")","+","--","output","(",")","Example",":","Suppose","we","want","to","swap","all","instances","of","``","torch.neg","``","with","``","torch.sigmoid","``","and","vice","versa","(","including","their","``","Tensor","``","method","equivalents",")",".","We","could","subclass","Interpreter","like","so",":",":","class","NegSigmSwapInterpreter","(","Interpreter",")",":","def","call_function","(","self",",","target",":","Target",",","args",":","Tuple",",","kwargs",":","Dict",")","-",">","Any",":","if","target","==","torch.sigmoid",":","return","torch.neg","(","*","args",",","*","*","kwargs",")","return","super","(",")",".call_function","(","n",")","def","call_method","(","self",",","target",":","Target",",","args",":","Tuple",",","kwargs",":","Dict",")","-",">","Any",":","if","target","==","'neg","'",":","call_self",",","*","args_tail","=","args","return","call_self.sigmoid","(","*","args_tail",",","*","*","kwargs",")","return","super","(",")",".call_method","(","n",")","def","fn","(","x",")",":","return","torch.sigmoid","(","x",")",".neg","(",")","gm","=","torch.fx.symbolic_trace","(","fn",")","input","=","torch.randn","(","3",",","4",")","result","=","NegSigmSwapInterpreter","(","gm",")",".run","(","input",")","torch.testing.assert_close","(","result",",","torch.neg","(","input",")",".sigmoid","(",")",")","Args",":","module","(","torch.nn.Module",")",":","The","module","to","be","executed","garbage_collect_values","(","bool",")",":","Whether","to","delete","values","after","their","last","use","within","the","Module","'s","execution",".","This","ensures","optimal","memory","usage","during","execution",".","This","can","be","disabled","to",",","for","example",",","examine","all","of","the","intermediate","values","in","the","execution","by","looking","at","the","``","Interpreter.env","``","attribute",".","graph","(","Optional","[","Graph","]",")",":","If","passed",",","the","interpreter","will","execute","this","graph","instead","of","`","module.graph","`",",","using","the","provided","`","module","`","argument","to","satisfy","any","requests","for","state","."]
docstr: Execute a ``call_module`` node and return the result.
  
  Args:
      target (Target): The call target for this node. See
          `Node <https://pytorch.org/docs/master/fx.html#torch.fx.Node>`__ for
          details on semantics
      args (Tuple): Tuple of positional args for this invocation
      kwargs (Dict): Dict of keyword arguments for this invocation
  
  Return
      Any: The value returned by the module invocation
docstr_tok: ["Execute","a","``","call_module","``","node","and","return","the","result",".","Args",":","target","(","Target",")",":","The","call","target","for","this","node",".","See","`","Node","<","https",":","\/\/pytorch.org\/docs\/master\/fx.html","#","torch.fx.Node",">","`","__","for","details","on","semantics","args","(","Tuple",")",":","Tuple","of","positional","args","for","this","invocation","kwargs","(","Dict",")",":","Dict","of","keyword","arguments","for","this","invocation","Return","Any",":","The","value","returned","by","the","module","invocation"]
code: def call_module(
      self,
      target: "Target",
      args: Tuple[Argument, ...],
      kwargs: Dict[str, Any],
  ) -> Any:
      """
      Execute a ``call_module`` node and return the result.
  
      Args:
          target (Target): The call target for this node. See
              `Node <https://pytorch.org/docs/master/fx.html#torch.fx.Node>`__ for
              details on semantics
          args (Tuple): Tuple of positional args for this invocation
          kwargs (Dict): Dict of keyword arguments for this invocation
  
      Return
          Any: The value returned by the module invocation
      """
      # Retrieve executed args and kwargs values from the environment
  
      # Execute the method and return the result
      assert isinstance(target, str)
      submod = self.fetch_attr(target)
  
      return submod(*args, **kwargs)
  
imports: from .graph_module import GraphModule
  from .graph import Graph
  from .node import Argument, Node, Target, map_arg, map_aggregate
  from .proxy import Proxy
  from ._symbolic_trace import Tracer
  from ._compatibility import compatibility
  from .None import config
  import torch.fx.traceback
  import torch
  from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
  import inspect
  from contextlib import contextmanager
  from torch.hub import tqdm
label_desc: Use image node_id 10 for calling the Interpreter obj's underlying member method code with example usage: obj.call_module(target, args, kwargs) and returns: submod