code: def symbolic_trace(
      # pyre-ignore[24]
      root: Union[torch.nn.Module, Callable],
      concrete_args: Optional[Dict[str, Any]] = None,
      leaf_modules: Optional[List[str]] = None,
  ) -> torch.fx.GraphModule:
      """
      Symbolic tracing API
  
      Given an ``nn.Module`` or function instance ``root``, this function will return a ``GraphModule``
      constructed by recording operations seen while tracing through ``root``.
  
      ``concrete_args`` allows you to partially specialize your function, whether it's to remove control flow or data structures.
  
      Args:
          root (Union[torch.nn.Module, Callable]): Module or function to be traced and converted
              into a Graph representation.
          concrete_args (Optional[Dict[str, any]]): Inputs to be partially specialized
  
      Returns:
          GraphModule: a Module created from the recorded operations from ``root``.
      """
      tracer = Tracer(leaf_modules)
      graph = tracer.trace(root, concrete_args)
      return torch.fx.GraphModule(root, graph)
  
file_path: torchrec/torchrec/fx/tracer.py
imports: from typing import Any, Callable, Dict, List, Optional, Union
  import torch
  from torch.fx._compatibility import compatibility
  from torch.fx.graph import Graph
  from torch.fx.node import Argument
  from torchrec.distributed.types import LazyAwaitable, NoWait
  from torchrec.fx.utils import dmp_fx_trace_forward
label_desc: Use image node_id 2 for calling a global function with example usage: symbolic_trace(root, concrete_args, leaf_modules) and returns: torch