+
    9i                         ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHt ^ RIHt ] P                  ! ]4      t ! R	 R
]4      t ! R R]4      tR# )    N)AttentionMask)FusionBartAttention)FusionOptions)FusionReshape)numpy_helper	OnnxModel)BertOnnxModelc                   D   a a ] tR t^t oV3R lV 3R lltR tRtVtV ;t# )FusionBartReshapec                    < V ^8  d   QhRS[ /# )   modelr   )format__classdict__s   "f/var/www/html/photoedit/myenv/lib/python3.14/site-packages/onnxruntime/transformers/onnx_model_bart.py__annotate__FusionBartReshape.__annotate__   s        i      c                &   < \         SV `  V4       R # N)super__init__)selfr   	__class__s   &&r   r   FusionBartReshape.__init__   s    r   c                L	   VP                   ^,          V9  d   R# W1P                   ^,          ,          pVP                  R8w  g   \        VP                   4      ^8w  d   R# V P                  P	                  V. RO. ROV4      pVf   R# Vw  rgp. p	V P                  P                  VP                   ^,          4      p
V
^ 8X  d   V	P                  ^ 4       V P                  P	                  V. RO. ROV4      pVEf   V P                  P                  VP                   ^,          4      pV P                  P                  VP                   ^,          4      pV P                  P                  VP                   ^,          4      pVe	   Ve   Vf   R# \        P                  ! V4      p\        P                  ! V4      p\        P                  ! V4      p\        V4      ^8w  g!   \        V4      ^8w  g   \        V4      ^8w  d   R# V^ ,          R8X  d   V^ ,          ^ 8  d   V^ ,          ^ 8  g   R# V	P                  V4       V	P                  V4       V	P                  V4       V P                  P	                  VRR.^ ^.V4      pV P                  P	                  VR.^ .V4      pVe   TpM	Ve   TpMR# VR,          pVP                   ^ ,          pV P                  WV4       R# Vw  pppV P                  P                  VP                   ^,          4      p
V
^8X  d   V	P                  ^ 4       V P                  P                  VP                   ^,          4      pV P                  P                  VP                   ^,          4      pVe   Vf   R# \        P                  ! V4      p\        P                  ! V4      p\        V4      ^8w  g   \        V4      ^8w  d   R# V^ ,          ^ 8  d   V^ ,          ^ 8  g   R# V	P                  V4       V	P                  V4       V P                  P	                  V. R	O. R
OV4      pVf   R# VR,          pVP                   ^ ,          pVP                   ^ ,          V8w  g   VP                   ^ ,          V8w  d   R# V P                  WV4       R# )   NConcatAddMatMul)	UnsqueezeGatherShape)r   r   r   )r   r   r   )Mulr    r!   )r   r   r   )inputop_typelenr   match_parent_pathget_constant_valueappendget_initializerr   to_arrayextendreplace_reshape_node)r   reshape_nodeinput_name_to_nodesoutput_name_to_nodeconcat_nodepath0_gather_0shape_0shapegather_valuepath1input_1_protoinput_2_protoinput_3_protoinput_1input_2input_3gemm_path_with_biasgemm_path_no_bias	gemm_path
top_matmul
root_inputgather_1shape_1s   &&&&                     r   fuseFusionBartReshape.fuse   s   a (;;)*<*<Q*?@(*c+2C2C.D.I

,,,	
 =!&gzz44X^^A5FG1LLO

,,,	
 = JJ66{7H7H7KLM JJ66{7H7H7KLM JJ66{7H7H7KLM$(=AV"++M:G"++M:G"++M:G7|q CLA$5W9JAJ"$aGAJNLL!LL!LL!"&**">">uh/!Q9L# !%

 < <\H:XYWZ\o p"./	".-	"2J#))!,J%%e;G%*"Q'::889JKLq Q JJ66{7H7H7KLM JJ66{7H7H7KLM$(="++M:G"++M:G7|q CLA$5AJNwqzA~LL!LL!

446	CVI  "2J#))!,J}}Q:-q1AZ1O%%e;Gr    )	__name__
__module____qualname____firstlineno__r   rI   __static_attributes____classdictcell____classcell__r   r   s   @@r   r   r      s        aH aHr   r   c                   ^   a a ] tR t^zt oRV 3R lltRV3R lV 3R llltR tR tRtVt	V ;t
# )	BartOnnxModelc                   < \         SV `  WV4       \        V 4      V n        \	        W P
                  V P                  V P                  4      V n        \        V 4      V n	        R # r   )
r   r   r   attention_maskr   hidden_size	num_headsattention_fusionr   bart_reshape_fusion_preprocess)r   r   rY   rX   
model_implr   s   &&&&&r   r   BartOnnxModel.__init__{   sN    ;7+D1 3D:J:JDNN\`\o\o p.?.E+r   c                4   < V ^8  d   QhRS[ R,          RS[/# )r   optionsNadd_dynamic_axes)r   bool)r   r   s   "r   r   BartOnnxModel.__annotate__   s      4 4 4 4t 4r   c                   < Vf   RMVP                   V P                  n         Vf   RMVP                  V P                  n        \        SV `  W4       R # NF)use_multi_head_attentionrZ   !disable_multi_head_attention_biasr   optimize)r   r_   r`   r   s   &&&r   rg   BartOnnxModel.optimize   sJ    BI/W^WwWw6_E'*S*S 	? 	3r   c                :    V P                   P                  4        R # r   )rZ   applyr   s   &r   fuse_attentionBartOnnxModel.fuse_attention   s    ##%r   c                Z    V P                  4        V P                  P                  4        R # r   )adjust_reshape_and_expandr[   rj   rk   s   &r   
preprocessBartOnnxModel.preprocess   s     &&(++113r   )rZ   rW   r[   )hfrd   )rL   rM   rN   rO   r   rg   rl   rp   rP   rQ   rR   rS   s   @@r   rU   rU   z   s$     F4 4&4 4r   rU   )loggingfusion_attentionr   fusion_bart_attentionr   fusion_optionsr   fusion_reshaper   onnxr   
onnx_modelr	   onnx_model_bertr
   	getLoggerrL   loggerr   rU   rK   r   r   <module>r}      sL   
  * 5 ( (    )			8	$eH eHP4M 4r   