Ë
    [^(hï  ã                   ó   — d Z ddlZddlZddlmZmZ ddlZddlmZ	m
Z
 ddlZddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$  ejJ                  e&«      Z' ejP                  d«      d„ «       Z)h d£Z*ejV                  fd	„Z, e-«       Z.ejV                  dd
œde/ej`                  ef   deejb                  e	f   fd„Z2y)a±  
This is a simple interpreter for Sympy expressions that dispatches to
classes following the torch._inductor.virtualized calling convention.
For directness, the interpreter takes the handler directly rather than
consulting the TLS.  It does not use most of the methods on the full
handler; only those with corresponding Sympy expressions.  To see an example
of a full handler, see torch.utils._sympy.value_ranges.ValueRangeAnalysis.
é    N)ÚAnyÚUnion)ÚBooleanÚBooleanAtomé   )ÚBitwiseFn_bitwise_andÚBitwiseFn_bitwise_orÚ	CeilToIntÚCleanDivÚFloatPowÚFloatTrueDivÚFloorDivÚ
FloorToIntÚIdentityÚ
IntTrueDivÚ!IsNonOverlappingAndDenseIndicatorÚMaxÚMinÚModÚModularIndexingÚOpaqueUnaryFn_log2ÚPowByNaturalÚ	PythonModÚRoundDecimalÚ
RoundToIntÚToFloatÚTruncToFloatÚ
TruncToIntÚWherec                  ó*  — i t         j                  d“t         j                  d“t         j                  d“t         j                  d“t         j
                  d“t         j                  d“t         j                  d“t         j                  d“t         j                  d	“t        d
“t        d“t        d“t        d“t        d“t        d“t         j                   d“t         j"                  d“i t$        d“t&        d“t         j(                  d“t*        d“t,        d“t         j*                  d“t         j.                  d“t         j0                  d“t         j2                  d“t         j4                  d“t         j6                  d“t4        d“t6        d“t8        d“t         j:                  j<                  j>                  j@                  d“t         jB                  d“tD        d“¥tF        dtH        dtJ        dtL        d tN        d!i¥} d"D ]  }|| tQ        t         |«      <   Œ | S )#NÚor_Úand_ÚeqÚneÚltÚgtÚleÚgeÚnot_Úint_truedivÚtruedivÚfloordivÚtruncÚwhereÚaddÚmulÚpowÚpow_by_naturalÚmodÚabsÚlogÚexpÚminimumÚmaximumÚmodular_indexingÚexpr_cond_pairÚ	piecewiseÚidentityÚ&is_non_overlapping_and_dense_indicatorÚround_decimalÚlog2Úbitwise_andÚ
bitwise_or)	ÚcosÚsinÚtanÚsinhÚcoshÚtanhÚasinÚacosÚatan))ÚsympyÚOrÚAndÚEqÚNeÚLtÚGtÚLeÚGeÚNotr   r   r   r   r   r   ÚAddÚMulr   r   ÚPowr   r   ÚAbsr5   r6   r   r   r   Ú	functionsÚ
elementaryr;   ÚExprCondPairÚ	Piecewiser   r   r   r   r   r	   Úgetattr)ÚHANDLERSÚnames     úW/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/utils/_sympy/interp.pyÚhandlersra   6   si  € ð2Ü�‰�%ð2ä�	‰	�6ð2ô 	�‰�$ð2ô 	�‰�$ð	2ô
 	�‰�$ð2ô 	�‰�$ð2ô 	�‰�$ð2ô 	�‰�$ð2ô 	�	‰	�6ð2ô 	�Mð2ô 	�ið2ô 	�*ð2ô 	�*ð2ô 	�gð2ô 	ˆwð2ô  	�	‰	�5ð!2ô" 	�	‰	�5ñ#2ô$ 	�%ð%2ô& 	Ð&ð'2ô4 	�	‰	Ð#ð52ô6 	ˆUð72ô8 	�5ð92ô@ 	�	‰	�5ðA2ôB 	�	‰	�5ðC2ôD 	�	‰	�5ðE2ôF 	�	‰	�5ðG2ôH 	�	‰	�9ðI2ôJ 	�	‰	�9ðK2ôL 	ˆYðM2ôN 	ˆYðO2ôP 	Ð+ðQ2ôR 	�‰×"Ñ"×,Ñ,×9Ñ9Ð;KðS2ôT 	�‰˜ðU2ôV 	�*ñW2ôX 	*Ð+SÜ�oä˜FÜ˜}Ü˜lñc2€Hðj Vò .ˆØ)-ˆ”œ Ó%Ò&ð.ð €Oó    >   r/   r0   r!   r"   r8   r7   c                 óÖ  — t        |t        j                  «      rOt        |j                  d   t        j                  j
                  j                  «      r| j                  |d   «      S t        |t        «      r#| j                  |d   t        j                  «      S t        dt        j                  dt        j                  dt        dt         dt"        di}|j%                  |j&                  «      x}� t)        | |«      g |¢|‘­Ž S |j&                  t        j*                  u rB|j,                  r6t/        | d«      r*| j1                  |«      }t2        j5                  d||«       |S t/        |j&                  d	«      r|j&                  j6                  }nt9        «       |j&                     }t)        | |«      }	 |t:        v r_t=        |«      dkD  sJ ‚ ||d   |d   «      }t?        d
t=        |«      «      D ]  }	 ||||	   «      }Œ t2        j5                  d|||«       |S  ||Ž }t2        j5                  d|||«       |S # t@        $ r ‚ tB        $ r t2        jE                  d||«       ‚ w xY w)Nr   r   Útrunc_to_intÚfloor_to_intÚceil_to_intÚround_to_intÚsym_sumzsym_sum(%s) -> %sÚ_torch_handler_nameé   z%s(%s) -> %szfailed while executing %s(%s))#Ú
isinstancerK   rW   ÚargsÚcoreÚnumbersÚHalfÚsqrtr   Úto_dtypeÚtorchÚfloat64r   ÚfloorÚceilingr   r
   r   ÚgetÚfuncr]   rU   Ú
is_integerÚhasattrrh   r5   Údebugri   ra   ÚASSOCIATIVE_OPSÚlenÚrangeÚNotImplementedErrorÚ	ExceptionÚwarning)
Úanalysisrl   ÚexprÚindex_dtypeÚINDEX_DTYPE_HANDLERSÚhandler_nameÚrÚhandlerÚaccÚis
             r`   Ú_run_sympy_handlerrŠ   {   s  € ä�$œŸ	™	Ô"¤zØ�	‰	�!‰”e—j‘j×(Ñ(×-Ñ-ô(ð �}‰}˜T !™WÓ%Ð%Ü�$œÔ Ø× Ñ   a¡¬%¯-©-Ó8Ð8ô 	�NÜ�‰�^Ü�‰�}Ü�NÜ�=Ü�NðÐð -×0Ñ0°·±Ó;Ð;ˆÐHØ.Œw�x Ó.ÐB°ÐB°kÒBÐBð ‡y�y”E—I‘IÑ $§/¢/´g¸hÈ	Ô6RØ×Ñ˜TÓ"ˆÜ�	‰	Ð% t¨QÔ/Øˆäˆt�y‰yÐ/Ô0Ø—y‘y×4Ñ4‰ä“z $§)¡)Ñ,ˆÜ�h Ó-€GðØœ?Ñ*Ü�t“9˜q’=Ð �=Ù˜$˜q™' 4¨¡7Ó+ˆCÜ˜1œc $›iÓ(ò ,�Ù˜c 4¨¡7Ó+‘ð,ä�I‰I�n l°D¸#Ô>ØˆJá˜�ˆAÜ�I‰I�n l°D¸!Ô<ØˆHøÜò ØÜò Ü�‰Ð3°\À4ÔHØðús   Æ7A&H= ÈH= È=+I(©rƒ   Úmissing_handlerÚenvr‚   c                ó,  — d }t        |t        «      rt        j                  }nUt        |t        j
                  «      rt        j                  }n*t        |t        j                  «      rt        j                  }|�| j                  ||«      S t        |t        j                  «      r5|j                  |t        «      x}t        ur|S |r ||«      S t        |«      ‚t        | |j                  D �cg c]  }t!        | ||||¬«      ‘Œ c}||¬«      S c c}w )Nr‹   )rƒ   )rk   r   rr   ÚboolrK   ÚIntegerÚint64ÚNumberÚdoubleÚconstantÚSymbolrv   Ú_nilÚKeyErrorrŠ   rl   Úsympy_interp)r�   r�   r‚   rƒ   rŒ   Údtyper†   Úargs           r`   r˜   r˜   ·   s÷   € ð €EÜ�$œÔ$Ü—
‘
‰Ü	�Dœ%Ÿ-™-Ô	(Ü—‘‰Ü	�Dœ%Ÿ,™,Ô	'Ü—‘ˆàÐØ× Ñ   uÓ-Ð-Ü	�Dœ%Ÿ,™,Ô	'Ø—‘˜œtÓ$Ð$ˆA¬TÑ1ØˆHÙÙ" 4Ó(Ð(ä˜4“.Ð ô Øð —y‘yö		
ð ô ØØØØ'Ø /öò		
ð 	Øôð ùò		
s   Ã0D
)3Ú__doc__Ú	functoolsÚloggingÚtypingr   r   rK   Úsympy.logic.boolalgr   ÚSympyBooleanr   rr   rY   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Ú	getLoggerÚ__name__r5   Ú	lru_cachera   r{   r‘   rŠ   Úobjectr–   Údictr•   ÚExprr˜   © rb   r`   ú<module>r¨      sÖ   ðñó Û ß ã ß Dã ÷÷ ÷ ÷ ÷ ÷ ó ð8 €g×Ñ˜Ó!€ð €×Ñ�TÓñ>ó ð>òB F€ð :?¿¹ó 6ñr ƒx€ð —‘Øò*à	ˆe�l‰l˜CÐÑ	 ð*ð �—
‘
˜LÐ(Ñ
)ô*rb   