+
    9i]                        ^ RI t ^ RIt^ RIt]P                  P	                  ]4      t]P                  P                  ]P                  P                  ]R4      4      '       d7   ]P                  P                  ]P                  P                  ]R4      4       M5]P                  P                  ]P                  P                  ]R4      4       ^ RI
HtHtHt ] P                  ! ]4      t ! R R]4      tR# )    Nz ../tools/symbolic_shape_infer.pyz../toolsz..)SymbolicShapeInferenceget_shape_from_type_protosympyc                   ^   a a ] tR t^t oRV 3R lltR	V3R lR lltR tR tR tRt	Vt
V ;t# )
SymbolicShapeInferenceHelperc                ^   < \         SV `  W4WR4       Wn        R V n        R V n        / V n        R# )FN)super__init__model_all_shapes_inferred_is_inferred_dynamic_axis_mapping_)selfmodelverboseint_max
auto_mergeguess_output_rank	__class__s   &&&&&&i/var/www/html/photoedit/myenv/lib/python3.14/site-packages/onnxruntime/transformers/shape_infer_helper.pyr
   %SymbolicShapeInferenceHelper.__init__   s0    .?I*/!"'57"    c                <   < V ^8  d   QhRS[ S[S[3,          RS[/# )   dynamic_axis_mappingmax_runs)dictstrint)format__classdict__s   "r   __annotate__)SymbolicShapeInferenceHelper.__annotate__   s#     ) )$sCx. )C )r   c                   Vf   Q hV P                   '       d   V P                  V8X  d   V P                  # Wn        V P                  V P                  4       ^ pV P
                  '       dI   \        P                  RV 24       V P                  4       V n        V^,          pV^ 8  g   KQ  W28  g   KY   RV n         V P                  # )ay  Run shape inference, and try replace dynamic axis from string to integer when mapping is provided.

Args:
    dynamic_axis_mapping (_type_): a dictionary with name of dynamic axis as key, like {"batch_size" : 4}
    max_runs (int, optional): limit maximum number of runs to avoid infinite loop. Defaults to 200.

Returns:
    bool: whether all shapes has been inferred or not.
zshape infer run T)	r   r   r   _preprocessr   run_loggerdebug_infer_impl)r   r   r   counts   &&& r   infer"SymbolicShapeInferenceHelper.infer   s     $///!;!;?S!S,,,%9"%iiiLL+E734(,(8(8(:D%QJE!| 1 (((r   c                   . pV P                  W4      pV'       d   V F  p\        V\        4      '       d   WPP                  9   d%   VP	                  V P                  V,          4       KM  WPP
                  9   d%   VP	                  V P
                  V,          4       K  VP	                  \        P                  ! VRR7      4       K  Vf   Q hVP	                  V4       K  	  V# )zQOverride it to ensure shape inference by giving the actual value of dynamic axis.T)integer)
_get_shape
isinstancer   r   appendsymbolic_dims_r   Symbol)r   nodeidxsympy_shapeshapedims   &&&   r   _get_sympy_shape-SymbolicShapeInferenceHelper._get_sympy_shape<   s    *c3''888#**4+E+Ec+JK 3 33#**4+>+>s+CD#**5<<T+JK?*?&&s+  r   c                   V P                   '       g   Q hWP                  9  d   \        R\        V4      ,           4       R# V P                  V,          P                  p\        V4      pVeT   \        V4       FD  w  rE\        V\        4      '       g   K  WPP                  9   g   K/  V P                  V,          W4&   KF  	  V# )zGet shape of an edge.

Args:
    edge (str): name of edge

Returns:
    Optional[List[int]]: the shape, or None if shape is unknown
zCannot retrieve the shape of N)	r   	known_vi_printr   typer   	enumerater0   r   )r   edge
type_protor7   ir8   s   &&    r   get_edge_shape+SymbolicShapeInferenceHelper.get_edge_shapeO   s     (((((~~%1CI=>^^D)..
)*5#E*c3''C3M3M,M#99#>EH + r   c                    V P                   '       g   Q hV P                  V4      pV P                  V4      pVe   Vf   \        R4      hW48H  # )zCompare shape of two edges.

Args:
    edge (str): name of edge
    edge_other (str): name of another edge

Raises:
    Exception: At least one shape is missed for edges to compare

Returns:
    bool: whether the shape is same or not
z1At least one shape is missed for edges to compare)r   rC   	Exception)r   r@   
edge_otherr7   shape_others   &&&  r   compare_shape*SymbolicShapeInferenceHelper.compare_shapeg   sU     (((((##D)))*5=K/OPP##r   )r   r   r   r   )r   iTF)   )__name__
__module____qualname____firstlineno__r
   r+   r9   rC   rI   __static_attributes____classdictcell____classcell__)r   r!   s   @@r   r   r      s(     8) )<&0$ $r   r   )loggingossyspathdirname__file__	file_pathexistsjoinr1   symbolic_shape_inferr   r   r   	getLoggerrL   r'   r    r   r   <module>r_      s     	 
 GGOOH%	77>>"'',,y*LMNNHHOOBGGLLJ78HHOOBGGLLD12 Y Y			8	$c$#9 c$r   