§
    Ÿ²Åj  ã                   ó~   — d dl Z d dlmZmZ d dlZd dlmZ dd„Zd„ Zdej	        j
        dee         fd„Zddefd
„ZdS )é    N)ÚDictÚOptional)Ú
LazyStringc                 óÎ   ‡ ‡‡‡‡— ˆˆ fd„Šd‰vrd‰d<   d‰v r:	 t           j                             ¦   «         sd‰d<   n# t          $ r d‰d<   Y nw xY wt	          ˆˆˆfd„¦  «        S )z;
    Returns a LazyString that formats the graph code.
    c                  ó   •— ‰ �‰› d‰ › �S ‰S )Nú © )Úmaybe_idÚnames   €€ú@C:\Projects\Historical\venv\Lib\site-packages\torch/fx/_utils.pyÚformat_namez+lazy_format_graph_code.<locals>.format_name   s"   ø€ ØÐØÐ'Ð'˜XÐ'Ð'Ð'àˆKó    Úprint_outputFÚcoloredc            	      ór   •— t          d ‰ ¦   «         › d�‰j        j        j         ‰j        di ‰¤Ž¦  «        S )Nz===== z =====
r	   )Ú_format_graph_codeÚforwardÚ__code__Úco_filenameÚprint_readable)r   ÚgmÚkwargss   €€€r   ú<lambda>z(lazy_format_graph_code.<locals>.<lambda>   sG   ø€ Õ"Ø,�[�[‘]”]Ð,Ð,Ð,ØŒJÔÔ+ØˆBÔÐ'Ð' Ð'Ð'ñ
ô 
€ r   )ÚsysÚstdoutÚisattyÚAttributeErrorr   )r   r   r
   r   r   s   ````@r   Úlazy_format_graph_coder   	   sÊ   øøøøø€ ð
ð ð ð ð ð ð ˜VÐ#Ð#Ø!&ˆˆ~Ñà�FÐÐð	&Ý”:×$Ò$Ñ&Ô&ð *Ø$)��yÑ!øøÝð 	&ð 	&ð 	&Ø %ˆF�9ÑÐÐð	&øøøõ ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ñô ð s   š#> ¾AÁAc                 ó   — d| › d|› d|› d�S )z7
    Returns a string that formats the graph code.
    zTRACED GRAPH
 r   ú
r	   )r   ÚfilenameÚ	graph_strs      r   r   r   '   s%   € ð =˜TÐ<Ð< HÐ<Ð<¨yÐ<Ð<Ð<Ð<r   ÚgraphÚreturnc                 ó`   — | j         D ]%}|j        dk    rd|j        v r|j        d         c S Œ&dS )zF
    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,   .   sI   € ð ”ð 0ð 0ˆØŒ7�oÒ%Ð%Ð*;¸t¼yÐ*HÐ*HØ”9Ð.Ô/Ð/Ð/Ð/øØˆ4r   é   c                 óà   — g }| }t          |¦  «        D ]=}|                     |                     ¦   «         ¦  «         |j        dk    r n|j        }Œ>d                     |ddd…         ¦  «        S )zD
    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   s{   € ð €MØ
€CÝ�9ÑÔð ð ˆØ×Ò˜SŸ_š_Ñ.Ô.Ñ/Ô/Ð/ØŒ6�VÒÐØˆEØŒhˆˆØ�9Š9�] 4 4 R 4Ô(Ñ)Ô)Ð)r   )N)r-   )r   Útypingr   r   ÚtorchÚtorch._loggingr   r   r   ÚfxÚGraphr,   Ústrr:   r	   r   r   ú<module>rA      s¸   ðà 
€
€
€
Ø !Ð !Ð !Ð !Ð !Ð !Ð !Ð !à €€€Ø %Ð %Ð %Ð %Ð %Ð %ðð ð ð ð<=ð =ð =ð¨u¬x¬~ð À(È4Ä.ð ð ð ð ð*ð *¨3ð *ð *ð *ð *ð *ð *r   