class_docstr: Custom FX tracer for torchrec
  
  See `Torch.FX documentation <https://pytorch.org/docs/stable/fx.html>`_
  
  We create a custom FX tracer to trace torchrec based models. The custom tracer
  handles python generic types (i.e. NoWait[T], Awaitable[T]) and lower it to
  TorchScript if needed
docstr: A method to specify the behavior of tracing when preparing values to
  be used as arguments to nodes in the ``Graph``.
  
  Adds support for the NoWait type in addition to the default tracer
  
  Args:
      a (Any): The value to be emitted as an ``Argument`` in the ``Graph``.
  
  Returns:
      Argument: The value ``a`` converted into the appropriate ``Argument``
docstr_tok: ["A","method","to","specify","the","behavior","of","tracing","when","preparing","values","to","be","used","as","arguments","to","nodes","in","the","``","Graph","``",".","Adds","support","for","the","NoWait","type","in","addition","to","the","default","tracer","Args",":","a","(","Any",")",":","The","value","to","be","emitted","as","an","``","Argument","``","in","the","``","Graph","``",".","Returns",":","Argument",":","The","value","``","a","``","converted","into","the","appropriate","``","Argument","``"]
code: def create_arg(self, a: Any) -> Argument:
      """
      A method to specify the behavior of tracing when preparing values to
      be used as arguments to nodes in the ``Graph``.
  
      Adds support for the NoWait type in addition to the default tracer
  
      Args:
          a (Any): The value to be emitted as an ``Argument`` in the ``Graph``.
  
      Returns:
          Argument: The value ``a`` converted into the appropriate ``Argument``
      """
      if isinstance(a, NoWait):
          return self.create_node(
              "call_function",
              target=NoWait,
              args=self.create_arg((a._obj,)),
              kwargs={},
              type_expr=NoWait,
          )
      # jit script has explicit convertions to torch.device from str
      if isinstance(a, torch.device):
          return super().create_arg(f"{a.type}:{a.index}")
  
      # Not equivalent to when LazyAwaitable.wait() is called in eager. Here can be called earlier, as attr was not requested and this is not guranteed to be torch function
      # TODO(ivankobzarev): support equivalent timing of LazyAwaitable
      if isinstance(a, LazyAwaitable):
          if a._result is None:
              a._result = a.wait()
          return super().create_arg(a._result)
  
      return super().create_arg(a)
  
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 4 for calling the Tracer obj's underlying member method code with example usage: obj.create_arg(a) and returns: super, self, super, super