
    3j[                     $   S SK r S SKJr  S SKrS SKJr   SS\S\R                  R                  S\	S-  S\S\4
S	 jjr
S\S
\S\S\4S jrS\R                  R                  S\\\4   S-  4S jrSS\R                  R                  S\	S\4S jjrg)    N)Any)
LazyStringnamegmmaybe_idkwargsreturnc                    ^ ^^^^ S[         4UU 4S jjmST;  a  STS'   ST;   a)   [        R                  R                  5       (       d  STS'   [        UUU4S j5      $ ! [         a    STS'    N"f = f)z3
Returns a LazyString that formats the graph code.
r	   c                     > T b  T ST  3$ T$ )N  )r   r   s   I/home/wildlama/miniconda3/lib/python3.13/site-packages/torch/fx/_utils.pyformat_name+lazy_format_graph_code.<locals>.format_name   s    V1XJ''K    print_outputFcoloredc            	         > [        ST " 5        S3TR                  R                  R                  TR                  " S0 TD65      $ )Nz===== z =====
r   )_format_graph_codeforward__code__co_filenameprint_readable)r   r   r   s   r   <lambda>(lazy_format_graph_code.<locals>.<lambda>    s=    "[]O8,JJ++''
r   )strsysstdoutisattyAttributeErrorr   )r   r   r   r   r   s   ````@r   lazy_format_graph_coder!      s       V#!&~F	&::$$&&$)y! 	
   	& %F9	&s   (A   A21A2filename	graph_strc                     SU  SU SU S3$ )z/
Returns a string that formats the graph code.
zTRACED GRAPH
 r   
r   )r   r"   r#   s      r   r   r   (   s     TF!H:Qyk<<r   graphc                     U R                    H6  nUR                  S:X  d  M  SUR                  ;   d  M'  UR                  S   s  $    g)z>
Returns the nn_module_stack of the first call_function node.
call_functionnn_module_stackN)nodesopmeta)r&   nodes     r   #first_call_function_nn_module_stackr.   /   s?     77o%*;tyy*H99.//  r   r-   	num_nodesc                     / nU n[        U5       HI  nUR                  [        UR                  5       5      5        UR                  S:X  a    OUR
                  nMK     SR                  USSS2   5      $ )z<
Returns a string of the last num_nodes nodes in the graph.
rootr%   N)rangeappendr   format_noder+   prevjoin)r-   r/   node_contextscur_s        r   get_node_contextr;   9   si     M
C9S!23466Vhh  99]4R4())r   )N)   )r   typingr   torchtorch._loggingr   r   fxGraphModuleintr!   r   Graphdictr.   Noder;   r   r   r   <module>rF      s    
   % AE
88''36:PS@=S =C =C =C =uxx~~ $sCx.SWBW *588== *S * *r   