ó
    EñiÈ  ã                   óŽ   • S SK r S SKJr  S SKrS SKJr  S
S jrS rS\R                  R                  S\\
   4S jrSS\4S	 jjrg)é    N)ÚOptional)Ú
LazyStringc                 óÚ   ^ ^^^^• UU 4S 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.
c                  ó   >• T b  T ST  3$ T$ )NÚ © )Úmaybe_idÚnames   €€ÚL/home/mande/repo/quber/.venv/lib/python3.13/site-packages/torch/fx/_utils.pyÚformat_nameÚ+lazy_format_graph_code.<locals>.format_name   s   ø€ ØÑØ�V˜1˜X˜JÐ'Ð'àˆ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   ÚgmÚkwargss   €€€r   Ú<lambda>Ú(lazy_format_graph_code.<locals>.<lambda>   s=   ø€ Ô"Ø‘[“]�O 8Ð,Ø�J‰J×Ñ×+Ñ+Ø×ÒÑ' Ñ'ô
r   )ÚsysÚstdoutÚisattyÚAttributeErrorr   )r
   r   r	   r   r   s   ````@r   Úlazy_format_graph_coder   	   su   ü€ ö
ð ˜VÓ#Ø!&ˆˆ~Ñà�FÓð	&Ü—:‘:×$Ñ$×&Ñ&Ø$)��yÑ!ô ö	
óð øô ó 	&Ø %ˆF�9Óð	&ús   Ÿ(A ÁA*Á)A*c                 ó   • SU  SU SU S3$ )z/
Returns a string that formats the graph code.
zTRACED GRAPH
 r   Ú
r   )r
   ÚfilenameÚ	graph_strs      r   r   r   '   s   € ð ˜T˜F ! H :¨Q¨y¨k¸Ð<Ð<r   ÚgraphÚreturnc                 ó�   • 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?   € ð —”ˆØ�7‰7�oÕ%Ð*;¸t¿y¹yÕ*HØ—9‘9Ð.Ñ/Ò/ñ ð r   c                 óÖ   • / nU n[        U5       H@  nUR                  UR                  5       5        UR                  S:X  a    OUR                  nMB     SR                  USSS2   5      $ )z<
Returns a string of the last num_nodes nodes in the graph.
Úrootr!   Néÿÿÿÿ)ÚrangeÚappendÚformat_noder*   ÚprevÚjoin)r,   Ú	num_nodesÚnode_contextsÚcurÚ_s        r   Úget_node_contextr:   8   sd   € ð €MØ
€CÜ�9ÖˆØ×Ñ˜SŸ_™_Ó.Ô/Ø�6‰6�VÓÙØ�h‰hŠñ	 ð
 �9‰9�]¡4 R 4Ñ(Ó)Ð)r   )N)é   )r   Útypingr   ÚtorchÚtorch._loggingr   r   r   ÚfxÚGraphÚdictr-   Ústrr:   r   r   r   Ú<module>rC      sF   ðã 
Ý ã Ý %ôò<=ð¨u¯x©x¯~©~ð À(È4Á.ô ñ*¨3ö *r   