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: for wrapping all the parameters of the function with dummy_input.
  in concrete tracer, we need all the parameters input by users.
  
  todo: this function should be refactored after the same function in torch.fx be refactored.
docstr_tok: ["for","wrapping","all","the","parameters","of","the","function","with","dummy_input",".","in","concrete","tracer",",","we","need","all","the","parameters","input","by","users",".","todo",":","this","function","should","be","refactored","after","the","same","function","in","torch.fx","be","refactored","."]
code: def create_args_for_root(
      self,
      root_fn,
      is_module,
      concrete_args: Union[Dict[str, Any], Tuple],
  ) -> Tuple[Any, list, Any, Any]:
      """
      for wrapping all the parameters of the function with dummy_input.
      in concrete tracer, we need all the parameters input by users.
  
      todo: this function should be refactored after the same function in torch.fx be refactored.
      """
      # In some cases, a function or method has been decorated with a wrapper
      # defined via ``functools.wraps``. In this case, the outer code object
      # will likely not contain the actual parameters we care about, so unwrap
      # the function to get to the innermost callable.
      fn_for_analysis = inspect.unwrap(root_fn)
      default_value_list = fn_for_analysis.__defaults__
      if default_value_list is None:
          default_value_list = tuple()
      co = fn_for_analysis.__code__
      total_args = co.co_argcount + co.co_kwonlyargcount
      # orig_args = list(co.co_varnames)
      names_iter = iter(co.co_varnames)
      args: List[Any] = []
      more_args = []
      kwargs = {}
      skip_arg_idx = 0
      if is_module:
          if total_args == 0:
              raise RuntimeError(
                  "``self`` argument cannot be part of *args expansion!"
              )
          skip_arg_idx = 1
          next(names_iter)  # skip self
          args.append(self.root)
  
      cnt = 0
      self.placeholder_dict = {}
      arg_names = [
          next(names_iter) for idx in range(skip_arg_idx, total_args)
      ]
      diff_len = _orig_len(arg_names) - _orig_len(default_value_list)
      default_args = {
          arg_names[idx + diff_len]: default_value_list[idx]
          for idx in range(len(default_value_list))
      }
      if isinstance(concrete_args, tuple):
          if _orig_len(arg_names) != _orig_len(concrete_args):
              raise RuntimeError(
                  f"Tracing expected {len(arg_names)} arguments but got {len(concrete_args)} concrete arguments"
              )
          concrete_args = {
              name: val for name, val in zip(arg_names, concrete_args)
          }
  
      def proxy_placeholder(name: str):
          nonlocal cnt
          cnt += 1
  
          default_arg = ()
          if name in default_args and not name.startswith("*"):
              default_arg = (default_args[name],)
  
          if name in concrete_args:
              self.placeholder_dict[name] = concrete_args[name]
          else:
              # TODO: better infomation
              assert name in default_args
              self.placeholder_dict[name] = default_args[name]
          return self.create_proxy("placeholder", name, default_arg, {})
  
      args.extend(proxy_placeholder(names) for names in arg_names)
  
      if hasattr(co, "co_kwonlyargcount") and (
          co.co_kwonlyargcount > 0 or co.co_flags & HAS_VARSTUFF
      ):
          # TODO: type annotations for *args and **kwargs
          if co.co_flags & inspect.CO_VARARGS:
              name = "*" + next(names_iter)
              default_args[name] = ()
              more_args = proxy_placeholder(name)
          if co.co_flags & inspect.CO_VARKEYWORDS:
              name = "**" + next(names_iter)
              default_args[name] = {}
              kwargs = proxy_placeholder(name)
  
      return root_fn, args, more_args, kwargs
  
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 11 for calling the ConcreteTracer obj's underlying member method code with example usage: obj.create_args_for_root(root_fn, is_module, concrete_args) and returns: root_fn,  args,  more_args,  kwargs, self