+
    –°³jó  ã                   óœ   € ^ RI t ^ RIHt ^ RIHt ^ RIt ^ RIHt ^ RIH	t	 ^ RI
Ht R tRR	 ltR
 tRR ltR#   ] d    ]! R4      Rhi ; i)é    N)Údefaultdict)Úpartial)Ú	graph_pb2)Ú	event_pb2)Ú
FileWriterzPTensorBoard visualization of GraphExecutors requires having TensorFlow installedc                 ó  € \        V4      ;_uu_ 4       p\        V 4      p\        P                  ! \        P                  ! 4       VP                  4       R 7      pVP                  V4       RRR4       R#   + '       g   i     R# ; i))Ú	wall_timeÚ	graph_defN)r   Ú	visualizer   ÚEventÚtimeÚSerializeToStringÚ	add_event)Úgraph_executorÚlogdirÚwÚpb_graphÚevts   &&   Ú_/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/contrib/_tensorboard_vis.pyÚdump_tensorboard_summaryr      sX   € Ü	�F×	Ô	˜qÜ˜^Ó,ˆÜ�oŠoÜ—i’i“k¨X×-GÑ-GÓ-Iô
ˆð 	
�‰�CÔ÷ 
×	×	Ò	ús   ”AA4Á4B	c           
     óÜ  € / pT;'       g    \         P                  ! 4       p\        V \        P                  P
                  4      '       d   \        WV\        \        VR7      4       V# VP                  P                  RVR,           R7       \        V P                  4       P                  4       4       F.  w  rVVR,           \        V4      ,           WFP                  4       &   K0  	  \!        WWV4       VP                  P                  RVR,           R7      pV P#                  4       P%                  4        F2  pVP&                  P)                  WFP                  4       ,          4       K4  	  V# )z5Visualizes an independent graph, or a graph executor.)r   Úinput©ÚopÚnamezinput:Úoutput)r   ÚGraphDefÚ
isinstanceÚtorchÚ_CÚGraphExecutorStateÚvisualize_graph_executorr   r   ÚnodeÚaddÚ	enumerateÚ
param_nodeÚoutputsÚstrÚuniqueÚvisualize_recÚreturn_nodeÚinputsr   Úappend)ÚgraphÚname_prefixr   Úexecutors_itÚ	value_mapÚiÚvaluer+   s   &&&&    r   r   r       s  € à€IØ×/Ð/œ9×-Ò-Ó/€Hä�%œŸ™×4Ñ4×5Ò5Ü Ø ¬'´)ÀhÔ*Oô	
ð ˆð ‡M�M×Ñ˜ {°WÕ'<ÐÔ=Ü˜e×.Ñ.Ó0×8Ñ8Ó:Ö;‰ˆØ$/°(Õ$:¼SÀ»VÕ$Cˆ	—,‘,“.Ó!ñ <ô �% K¸<ÔHð —-‘-×#Ñ# x°kÀHÕ6LÐ#ÓM€KØ×"Ñ"Ó$×+Ñ+Ö-ˆØ×Ñ× Ñ  ¯<©<«>Õ!:Ö;ñ .ð €Oó    c           
     ó´  € V P                   eB   \        V P                   VR,           V\        V P                  P	                  4       4      R7       \        V P                  P                  4       4       FÉ  w  pw  rVVRV R2,           pVP                  P                  RVR7      p\        V4      P                  R4      VP                  R,          n        \        VP                  Wr\        VP                  P	                  4       4      4       VP                   f   Kª  VR	,           p	\        VP                   W’4       KË  	  V! V P                  VR
,           4      # )a   Append the state of a given GraphExecutor to the graph protobuf.

Args:
    state (GraphExecutor or GraphExecutorState): GraphExecutor to display.
    name_prefix (str): Name prefix of the containing subgraph.
    pb_graph (GraphDef): graph to append to.
    inline_graph (Callable): a function that handles setting up a value_map,
        so that some graphs in here can be inlined. This is necessary, because
        this will simply be `visualize` for the top-level GraphExecutor,
        or `inline_graph` for all nested ones.

        The signature should look like (Graph, name_prefix) -> ().
        It will be called exactly once.

The strategy is to embed all different configurations as independent subgraphs,
while inlining the original graph as the one that actually produces the values.
zautograd_fallback/)r.   r/   r   r0   ÚplanÚ/Ú
INPUT_KINDr   Úasciir,   zgrad/z	original/)Úautograd_fallback_graphr   ÚiterÚautograd_fallbackÚ	executorsr%   Úexecution_plansÚitemsr#   r$   ÚreprÚencodeÚattrÚsr.   ÚcodeÚgrad_executor)
Ústater/   r   Úinline_graphr2   Úarg_specr6   Úsubgraph_nameÚinput_kindsÚgrad_subgraph_names
   &&&&      r   r"   r"   :   s   € ð$ ×$Ñ$Ò0ÜØ×/Ñ/Ø#Ð&:Õ:ØÜ˜e×5Ñ5×?Ñ?ÓAÓBõ		
ô  )¨×)>Ñ)>×)DÑ)DÓ)FÖGÑˆÑˆHØ#¨¨Q¨C¨q kÕ1ˆð
 —m‘m×'Ñ'¨<¸mÐ'ÓLˆÜ'+¨H£~×'<Ñ'<¸WÓ'Eˆ×Ñ˜Õ"Ô$ä�$—*‘*˜m´t¸D¿I¹I×<OÑ<OÓ<QÓ7RÔSð ×ÑÔ)Ø!.°Õ!8ÐÜ�d×(Ñ(Ð*<ÖGñ  Hñ  ˜Ÿ™ [°;Õ%>Ó?Ð?r4   c                óÈ   aaaaaaaa	a
a€ VV3R lo	\        \        4      oVV3R lo
V	V
3R loVVV	V
V3R loVVV
VV3R loV P                  4        F  pS! V4       K  	  R# )zTRecursive part of visualize (basically skips setting up the input and output nodes).c                 óž  <€ \        V P                  4       VP                  4       4       UUu/ uF+  w  r4VP                  4       SVP                  4       ,          bK-  	  ppp\        WVSR 7       \        V P	                  4       VP	                  4       4       F,  w  rdWVP                  4       ,          SVP                  4       &   K.  	  R# u uppi ))r.   r1   r/   r   N)Úzipr,   r)   r*   r'   )	Úsubgraphr   r#   ÚinpÚvalÚrec_value_mapÚoutr   r1   s	   &&&    €€r   rG   Ú#visualize_rec.<locals>.inline_graphj   s¦   ø€ ô   §¡Ó 1°4·;±;³=ÔAô
áA‘�ð �J‰J‹L˜) C§J¡J£LÕ1Ò1ÙAð 	ñ 
ô 	ØÀÐPXõ	
ô ˜H×,Ñ,Ó.°·±³Ö?‰HˆCØ&3·J±J³LÕ&AˆI�c—j‘j“lÓ#ó @ùó
s   ­1C	c                 óî   <€ V P                  4       V P                  4       P                  R 4      ^,           R pSV;;,          ^,          uu&   VSV,           R,           \        SV,          4      ,           3# )z::NÚ_)ÚkindÚindexr(   )r#   rW   r/   Úop_id_counters   & €€r   Úname_forÚvisualize_rec.<locals>.name_forw   s`   ø€ Ø�y‰y‹{˜4Ÿ9™9›;×,Ñ,¨TÓ2°QÕ6Ð8Ð9ˆØ�d×˜qÕ ÓØ�[ 4Õ'¨#Õ-´°MÀ$Õ4GÓ0HÕHÐHÐHr4   c                 ó\   <€ S! V 4      w  rS! V P                  R 4      VR,           V 4       R# )ÚSubgraphr7   N)Úg)r#   r   r   rG   rZ   s   &  €€r   Úadd_fusion_groupÚ'visualize_rec.<locals>.add_fusion_group|   s'   ø€ Ù˜D“>‰ˆÙ�T—V‘V˜JÓ'¨°­°TÖ:r4   c           
      óŒ   <€ S! V 4      w  rSf   S! V 4       R # \        S4      p\        W2R,           S\        SV R7      4       R # )Nr7   )r#   )Únextr"   r   )	r#   r   r   ÚgeÚadd_noder0   rG   rZ   r   s	   &   €€€€€r   Úadd_graph_executorÚ)visualize_rec.<locals>.add_graph_executor€   s?   ø€ Ù˜D“>‰ˆØÒÙ�TŽNä�lÓ#ˆBÜ$Ø˜3•J ¬'°,ÀTÔ*Jör4   c                 óî  <€ V P                  4       R 8X  d	   S! V 4      # V P                  4       R8X  d	   S! V 4      # S! V 4      w  rS	P                  P                  WR7      pV P                  4        F3  pVP                  P                  S
VP                  4       ,          4       K5  	  \        V P                  4       4       F/  w  rTVR,           \        V4      ,           S
VP                  4       &   K1  	  R# )zprim::FusionGroupzprim::GraphExecutorr   Ú:N)
rW   r#   r$   r,   r   r-   r)   r%   r'   r(   )r#   r   r   Úpb_noder3   r2   r_   re   rZ   r   r1   s   &     €€€€€r   rd   Úvisualize_rec.<locals>.add_nodeŠ   s¼   ø€ Ø�9‰9‹;Ð-Ô-Ù# DÓ)Ð)Ø�Y‰Y‹[Ð1Ô1Ù% dÓ+Ð+Ù˜D“>‰ˆØ—-‘-×#Ñ# rÐ#Ó5ˆØ—[‘[–]ˆEØ�M‰M× Ñ  ¨5¯<©<«>Õ!:Ö;ñ #ô " $§,¡,£.Ö1‰HˆAØ(,¨s­
´S¸³VÕ(;ˆI�e—l‘l“nÓ%ó 2r4   N)r   ÚintÚnodes)r.   r1   r/   r   r0   r#   r_   re   rd   rG   rZ   rY   s   &ffff @@@@@@r   r*   r*   g   sN   ÿù€ ö	Bô ,7´sÓ+;€MöIö
;÷ñ ÷<ñ <ð —‘–ˆÙ�Žó r4   )Ú NN)N)r   Úcollectionsr   Ú	functoolsr   r   Útensorflow.core.frameworkr   Útensorflow.core.utilr   Ú'tensorflow.python.summary.writer.writerr   ÚImportErrorr   r   r"   r*   © r4   r   Ú<module>ru      s^   ðã Ý #Ý ã ðÝ3Ý.ÝBòôò4*@öZ1øðo ô Ù
ð	óð ððús	   –: ºA