+
    G-j  ã                   ó\   € ^ RI Ht ^ RIHt ^ RIHt ^ RIHt ]! ]4      t	 ! R R]4      t
R# )é    )Ú	getLogger)ÚFusion)Úhelper©Ú	OnnxModelc                   óP   a a€ ] tR t^t oV3R lV 3R lltV3R lR ltRtVtV ;t# )ÚFusionBiasSplitGeluc                ó    <€ V ^8„  d   QhRS[ /# )é   Úmodelr   )ÚformatÚ__classdict__s   "€Ú~/Volumes/fast/ai/experiments/nudenet-smoke/.venv/lib/python3.14/site-packages/onnxruntime/transformers/fusion_biassplitgelu.pyÚ__annotate__Ú FusionBiasSplitGelu.__annotate__   s   ø€ ÷ 9ñ 9™iñ 9ó    c                ó*   <€ \         SV `  VR R4       R# )ÚBiasSplitGeluÚGeluN)ÚsuperÚ__init__)Úselfr   Ú	__class__s   &&€r   r   ÚFusionBiasSplitGelu.__init__   s   ø€ Ü‰Ñ˜ °Ö8r   c                ó&   <€ V ^8„  d   QhRS[ RS[ /# )r   Úinput_name_to_nodesÚoutput_name_to_node)Údict)r   r   s   "€r   r   r      s#   ø€ ÷ \Gñ \G±4ð \GÉdñ \Gr   c                ó   € VP                   ^ ,          V9  d   R# W!P                   ^ ,          ,          p\        V4      ^8w  g   V^ ,          P                  R8w  d   R# V^ ,          pV P                  P	                  VR^ V4      pVf   R# V P                  P                  VRRR7      ^8w  d   R# VP                  ^ ,          pV P                  P                  V. RO. ROV4      pVf#   V P                  P                  V. RO. ROV4      pVe    VR,          P                  ^ ,          V8w  d   R# V P                  P                  VRR.^^ .V4      p	V	e   V	^,          V9  d   R# V P                  P	                  VR^ V4      p
V
f   R# V
P                  ^,          VP                  ^,          8w  d   R# . VOV	^ ,          NVNVNV
NVNpVP                   ^ ,          pV P                  P                  W¼.W#4      '       g   \        P                  R4       R# VR,          pV P                  P                  V4      w  rï\        V\        4      '       g   R# V P                  P                  V4       V P                  P!                  RRR	7      p\"        P$                  ! RVP                  ^V,
          ,          VP                  V,          .V.VR
7      pRVn        V P(                  P+                  V4       V P,                  V P.                  V&   R# )aT  
[root] --->Add -------------------->  Slice ---------------> Mul -->
           |                            ^                    ^
           |                            |                    |
           +----------------------------+---Slice --> Gelu---+
           |                            |     ^
           |                            |-----|
           |                            |     |
           |                           Mul   Mul
           |                            ^     ^
           v                            |     |
          Shape ---> Gather --> Add --> Div --+
NÚMulÚSlicegü©ñÒMbP?)ÚdeltaÚDivzBSkip fuse BiasSplitGelu since it is not safe to fuse the subgraph.r   )Úname_prefix)ÚinputsÚoutputsÚnamezcom.microsoftéÿÿÿÿ)r#   ÚAddÚGatherÚShaper)   )é   r   r   r   r   )r    r#   r)   r*   r+   r)   )r,   r   r   r   r   r   éþÿÿÿ)ÚoutputÚlenÚop_typer   Úmatch_parentÚfind_constant_inputÚinputÚmatch_parent_pathÚis_safe_to_fuse_nodesÚloggerÚinfoÚget_constant_inputÚ
isinstanceÚintÚnodes_to_removeÚextendÚcreate_node_namer   Ú	make_nodeÚdomainÚnodes_to_addÚappendÚthis_graph_nameÚnode_name_to_graph_name)r   Ú	gelu_noder   r   ÚchildrenÚmul_after_geluÚslice_before_geluÚ
add_outputÚstart_index_nodesÚend_index_nodesÚslice_before_mulÚsubgraph_nodesÚsubgraph_outputÚadd_nodeÚ
bias_indexÚ_valueÚ	node_nameÚ
fused_nodes   &&&&              r   ÚfuseÚFusionBiasSplitGelu.fuse   sù  € ð ×Ñ˜AÕÐ&9Ô9ÙØ&×'7Ñ'7¸Õ':Õ;ˆÜˆx‹=˜AÔ ¨!¥×!4Ñ!4¸Ô!=ÙØ! !�ˆà ŸJ™J×3Ñ3°I¸wÈÐK^Ó_ÐØÒ$Ùà�:‰:×)Ñ)Ð*;¸RÀuÐ)ÓMÐQRÔRÙà&×,Ñ,¨QÕ/ˆ
à ŸJ™J×8Ñ8ØÚ4ÚØó	
Ðð Ò$Ø $§
¡
× <Ñ <Ø!Ú?Ú"Ø#ó	!Ðð Ò$Ð(9¸"Õ(=×(CÑ(CÀAÕ(FÈ*Ô(TÙàŸ*™*×6Ñ6Ð7HÈ5ÐRWÈ.Ð[\Ð^_ÐZ`ÐbuÓvˆð Ò# °qÕ'9ÐARÔ'RáàŸ:™:×2Ñ2°>À7ÈAÐObÓcÐØÒ#Ùð ×"Ñ" 1Õ%Ð):×)@Ñ)@ÀÕ)CÔCáð
Øð
à˜AÕð
ð ð
ð ð	
ð
 ð
ð ð
ˆð )×/Ñ/°Õ2ˆØ�z‰z×/Ñ/ØÐ-Ð/B÷
ò 
ô �K‰KÐ\Ô]Ùà$ RÕ(ˆØ!ŸZ™Z×:Ñ:¸8ÓDÑˆ
Ü˜*¤c×*Ò*ÙØ×Ñ×#Ñ# NÔ3Ø—J‘J×/Ñ/°È_Ð/Ó]ˆ	Ü×%Ò%ØØ—N‘N 1 z¥>Õ2°H·N±NÀ:Õ4NÐOØ$Ð%Øô	
ˆ
ð ,ˆ
ÔØ×Ñ× Ñ  Ô,Ø26×2FÑ2Fˆ×$Ñ$ YÓ/r   © )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   rS   Ú__static_attributes__Ú__classdictcell__Ú__classcell__)r   r   s   @@r   r	   r	      s$   ù‡ € ÷9ó 9÷\G÷ \Gð \Gr   r	   N)Úloggingr   Úfusion_baser   Úonnxr   Ú
onnx_modelr   rV   r6   r	   rU   r   r   Ú<module>ra      s-   ðõ
 å Ý Ý  á	�8Ó	€ô`G˜&ö `Gr   