class_docstr: A model tracer similar to _symbolic_trace.Tracer, but with concrete execution and real value so we can pass complex conditions
  and go into correct brunches.
class_docstr_tok: ["A","model","tracer","similar","to","_symbolic_trace.Tracer",",","but","with","concrete","execution","and","real","value","so","we","can","pass","complex","conditions","and","go","into","correct","brunches","."]
docstr: similar to _symbolic_trace.Tracer.create_arg
  move the base case to the top in case the wrapping of the function 'isinstance'
docstr_tok: ["similar","to","_symbolic_trace.Tracer.create_arg","move","the","base","case","to","the","top","in","case","the","wrapping","of","the","function","'isinstance","'"]
code: def create_arg(self, a: Any) -> Union[Node, Any]:
      """
      similar to _symbolic_trace.Tracer.create_arg
      move the base case to the top in case the wrapping of the function 'isinstance'
      """
      # base case: we unwrap the Proxy object
      if isinstance(a, ep.ConcreteProxy):
          return a.node
  
      if isinstance(a, torch.nn.Parameter):
          for n, p in self.root.named_parameters():
              if a is p:
                  return self.create_node("get_attr", n, (), {})
          raise NameError("parameter is not a member of this module")
      elif isinstance(a, torch.Tensor):
          for n_, p_ in self.root.named_buffers():
              if a is p_:
                  return self.create_node("get_attr", n_, (), {})
      elif isinstance(a, torch.nn.Module):
          for n_, p_ in self.root.named_modules():
              if a is p_:
                  return self.create_node("get_attr", n_, (), {})
      # for slice
      if isinstance(a, slice):
          start = self.create_arg(a.start)
          stop = self.create_arg(a.stop)
          step = self.create_arg(a.step)
          if (
              _orig_isinstance(start, Node)
              or _orig_isinstance(stop, Node)
              or _orig_isinstance(step, Node)
          ):
              return self.create_node(
                  "call_function", _orig_slice, (start, stop, step), {}
              )
          else:
              return a
      # For NamedTuple instances that appear literally as args, we emit
      # a node to construct the NamedTuple and use that Node as the argument.
      if isinstance(a, tuple) and hasattr(a, "_fields"):
          args = tuple(self.create_arg(elem) for elem in a)
          return self.create_node(
              "call_function", a.__class__, args, {}
          )
  
      # Tensors do not have a reliable string repr() from which they can be
      # constructed (and we probably don't want to rely on that, either), so
      # for any constant Tensor values we encounter, first search for if they
      # are an attribute of some module in the module hierarchy. If so, emit
      # a get_attr to retrieve that tensor. Otherwise, we'll store away the
      # tensor value into a special attribute on the Module s.t. we can
      # retrieve it with a get_attr.
      if isinstance(a, (torch.Tensor, ScriptObject)):
          qualname: Optional[str] = self.tensor_attrs.get(a)
  
          # Tensor was not found in the Module hierarchy, stow it away in a
          # TODO: warning for the not found tensor
          if not qualname:
              i = 0
              while True:
                  qualname = f"_tensor_constant{i}"
                  if not hasattr(self.root, qualname):
                      break
                  i += 1
              self.tensor_attrs[a] = qualname
              setattr(self.root, qualname, a)
  
          return self.create_node("get_attr", qualname, (), {})
  
      if _orig_type(a) in _proxyable_classes:
          # This is an instance of a proxyable class for which we did not
          # witness its construction. Intern this as a constant attribute
  
          # TODO: binary search
          i = 0
          while True:
              qualname = f"_{a.__class__.__name__}_constant_{i}"
              if not hasattr(self.root, qualname):
                  break
              i += 1
          setattr(self.root, qualname, a)
  
          return self.create_node("get_attr", qualname, (), {})
  
      if isinstance(
          a,
          (
              torch.autograd.function.Function,
              torch.autograd.function.FunctionMeta,
          ),
      ):
          return a
  
      return super().create_arg(a)
  
imports: from __future__ import annotations
  import collections
  import copy
  import sys
  import inspect
  import logging
  import operator
  import functools
  import builtins
  from itertools import chain
  from types import BuiltinMethodType, FunctionType, MethodDescriptorType, MethodType, MethodWrapperType, ModuleType
  from typing import Any, Dict, Iterable, Iterator, Optional, Set, Tuple, Type, List, Callable, Union
  from contextlib import contextmanager
  import torch
  from torch._C import ScriptObject
  from torch.nn.modules.container import Sequential, ModuleList, ModuleDict, ParameterList, ParameterDict
  from torch.utils._pytree import tree_map
  import torch.fx
  from torch.fx import GraphModule
  from torch.fx._compatibility import compatibility
  from torch.fx._symbolic_trace import _Patcher, _proxyable_classes
  from torch.fx.graph import Graph
  from torch.fx.node import Target, Node, Argument, _side_effectful_functions
  from torch.fx.proxy import TracerBase
  from torch.fx.operator_schemas import check_for_mutable_operation
  from .None import concrete_proxy
  from .operator_patcher import OperatorPatcherContext
  from .utils import _orig_module_call, _orig_module_getattr, _orig_module_getattribute, _orig_agfunc_apply, _orig_torch_assert, _orig_type, _orig_isinstance, _orig_issubclass, _orig_getattr, _orig_range, _orig_int, _orig_bool, _orig_tuple, _orig_list, _orig_set, _orig_frozenset, _orig_dict, _orig_map, _orig_zip, _orig_enumerate, _orig_slice, _orig_reversed, _orig_torch_size, _orig_torch_finfo, _orig_len, _orig_not, _orig_is, _orig_is_not, _orig_contains, _orig_index, _orig_all, _orig_min, _orig_max, _orig_node_is_impure
label_desc: Use image node_id 8 for calling the ConcreteTracer obj's underlying member method code with example usage: obj.create_arg(a) and returns: super, a, self, self, self, a, self, a, self, self, self