+
    –°³j§0  ã                   ó”   € ^ RI t ^ RIHt ^ RIt^ RIHu Ht R tR t	R t
R tR t] P                  R 4       tR	 tR
 tR tR tR tR# )é    N)Ú
namedtuplec                 ó.   a a€ \        S 4      oVV 3R  lpV# )c                  ó–  <€ SP                  R 4      '       d$   SP                  R 4      P                  pV! V / VB # SP                  R4      '       g   SP                  R4      '       dZ   SP                  R4      '       d   RMRpVR8X  d   RMRpSP                  V4      P                  p\	        RV RS RV RV R2	4      hS! V / VB # )ÚautogradÚsave_for_backwardÚbackwardzWe found a 'z' registration for ú at z but were unable to find a 'zÔ' registration. To use the CustomOp API to register a backward formula, please provide us both a backward function and a 'save for backward' function via `impl_backward` and `impl_save_for_backward` respectively.)Ú	_has_implÚ	_get_implÚfuncÚlocationÚRuntimeError)ÚargsÚkwargsÚkernelÚmissingÚfoundÚlocÚautograd_fallbackÚ	custom_ops   *,    €€ÚZ/home/luca/screen-checking/.venv/lib/python3.14/site-packages/torch/_custom_op/autograd.pyÚinnerÚ*autograd_kernel_indirection.<locals>.inner   så   ø€ Ø×Ñ˜z×*Ò*Ø×(Ñ(¨Ó4×9Ñ9ˆFÙ˜4Ð* 6Ñ*Ð*ð
 ×ÑÐ2×3Ò3°y×7JÑ7JÈ:×7VÒ7Và'0×':Ñ':¸:×'FÒ'FÑ#ÈJð ð ,3°jÔ+@Ñ'ÀjˆEØ×%Ñ% eÓ,×5Ñ5ˆCÜØ˜u˜gÐ%8¸¸À4Ø�%Ð3°G°9ð =9ð:óð ñ ! $Ð1¨&Ñ1Ð1ó    )Úautograd_not_implemented)r   r   r   s   f @r   Úautograd_kernel_indirectionr      s   ù€ Ü0°Ó;Ðö2ð0 €Lr   c                 ó   a € V 3R  lpV# )c                  ó(  <€ \         P                  ! 4       '       d+   \        P                  ! R  W34      '       d   \	        R4      h\         P
                  P                  4       ;_uu_ 4        S! V / VB uuRRR4       #   + '       g   i     R# ; i)c                 ó^   € \        V \        P                  4      ;'       d    V P                  # ©N)Ú
isinstanceÚtorchÚTensorÚrequires_grad©Úxs   &r   Ú<lambda>Ú:autograd_not_implemented.<locals>.kernel.<locals>.<lambda>6   s   € ”j ¤E§L¡LÓ1×EÐE°a·o±oÐEr   z.Autograd has not been implemented for operatorN)r"   Úis_grad_enabledÚpytreeÚtree_anyr   Ú_CÚ_AutoDispatchBelowAutograd)r   r   r   s   *,€r   r   Ú(autograd_not_implemented.<locals>.kernel4   sf   ø€ Ü× Ò ×"Ò"¤v§¢ÙEÈÀ~÷(
ò (
ô ÐOÓPÐPÜ�X‰X×0Ñ0×2Õ2Ù˜dÐ- fÑ-÷ 3×2×2Ó2ús   Á-B Â B	© )r   r   s   f r   r   r   3   s   ø€ õ.ð €Mr   c                 ó`  € VEe)   \        V\        4      '       g   V3pMTp\        V4      \        V4      8w  d$   \        R\        V4       R\        V4       24      h. p\	        \        W#4      4       Fš  w  pw  rg\        V\        P                  4      '       d   V'       g   VP                  V4       KC  \        V\        4      '       d   V'       g   VP                  V4       Kt  V'       g   K~  \        RV RV R\        V4       R24      h	  V'       d   V P                  ! V!   R # R # R # )Nz output_differentiability length z != output length zWith output_differentiability=z	. At idx z , we received an object of type zc that is not a Tensor, so it cannot have been marked as differentiable in output_differentiability.)r!   ÚtupleÚlenÚAssertionErrorÚ	enumerateÚzipr"   r#   ÚappendÚlistÚextendr   ÚtypeÚmark_non_differentiable)ÚctxÚoutputÚoutput_differentiabilityÚtuple_outputÚnon_differentiable_tensorsÚidxÚdifferentiableÚouts   &&&     r   r:   r:   ?   s1  € ð  Ó+Ü˜&¤%×(Ò(Ø"˜9‰Là!ˆLÜÐ'Ó(¬C°Ó,=Ô=Ü Ø2´3Ð7OÓ3PÐ2Qð R$Ü$'¨Ó$5Ð#6ð8óð ð &(Ð"Ü*3ÜÐ(Ó7ö+
Ñ&ˆCÑ&�.ô ˜#œuŸ|™|×,Ò,ß%Ø.×5Ñ5°cÔ:ÙÜ˜#œt×$Ò$ß%Ø.×5Ñ5°cÔ:Ùß‰~Ü"Ø4Ð5MÐ4Nð OØ!˜UÐ"BÄ4ÈÃ9À+ð N0ð1óð ñ+
÷$ &Ø×'Ò'Ð)CÔDñ &ñ; ,r   c                 ó(   a aaaaa€ VVVVVV 3R  lpV# )c                  ó  <aa€ \         P                  ! V 4      w  poR oV
VVVVV3R lpVV	V3R lp\        S	P                  R,           W#4      pVP                  ! V!  pSf   \        R4      h\         P                  ! \        V4      S4      # )Nc                 óä  <€ V P                  R 4       \        P                  ! \        V4      S4      p\        P
                  P                  4       ;_uu_ 4        S! V!  pRRR4       \        S\        P                  ! \        V4      4      p\        SV4      pS! VX4      p\        WV34       \        WS
4       \        P                  ! V4      w  po	\        V4      #   + '       g   i     L‡; i)TN)Úset_materialize_gradsr*   Útree_unflattenr7   r"   r,   r-   Únamedtuple_argsÚtree_mapr9   Úsave_pytree_for_backwardr:   Útree_flattenr1   )r;   Ú	flat_argsr   r<   Ú	args_infoÚsave_for_backward_fn_inputsÚto_saveÚflat_outputÚop_overloadÚout_specr=   Úsave_for_backward_fnÚschemaÚspecs   &*      €€€€€€r   ÚforwardÚ9construct_autograd_kernel.<locals>.apply.<locals>.forwardr   s¿   ø€ Ø×%Ñ% dÔ+Ü×(Ò(¬¨i«¸$Ó?ˆDÜ—‘×4Ñ4×6Õ6Ù$ dÑ+�÷ 7ô (¨´·²ÄÀdÓ0KÓLˆIä*9¸&À$Ó*GÐ'Ù*Ð+FÈÓOˆGä$ S°IÐ*>Ô?Ü# CÐ1IÔJô %+×$7Ò$7¸Ó$?Ñ!ˆK˜Ü˜Ó%Ð%÷ 7×6ús   ÁCÃC/	c                 ó  <€ S	f   \        R4      h\        P                  ! \        V4      S	4      p\	        V 4      w  r4\        4       p\        V\        4      '       g   V3pS! WS.VO5!  p\        VSV4       \        Wd4      # )Núout_spec is unexpectedly None)
r3   r*   rG   r7   Úunpack_savedÚobjectr!   r1   Úvalidate_grad_inputs_dictÚgrad_inputs_dict_to_flat_tuple)
r;   Úflat_grad_outputÚgradsÚsavedrM   Ú	inner_ctxÚgrad_inputs_dictÚbackward_fnr   rR   s
   &*     €€€r   r   Ú:construct_autograd_kernel.<locals>.apply.<locals>.backward…   s‚   ø€ ØÒÜ$Ð%DÓEÐEÜ×)Ò)¬$Ð/?Ó*@À(ÓKˆEÜ+¨CÓ0ÑˆEô ›ˆIÜ˜e¤U×+Ò+Ø˜�Ù*¨9ÐD¸eÓDÐô &Ð&6¸	À9ÔMÜ1Ð2BÓNÐNr   Ú	_customoprY   )r*   rK   Úgen_autograd_functionÚ_opnameÚapplyr3   rG   r7   )r   rL   rV   r   Úgenerated_clsrP   rR   rU   rc   r   rQ   r=   rS   rT   s   *     @@€€€€€€r   rh   Ú(construct_autograd_kernel.<locals>.applyn   s„   ú€ Ü ×-Ò-¨dÓ3‰ˆ	�4Øˆ÷	&ò 	&÷&	Oô" .Ø×Ñ Õ+¨Wó
ˆð $×)Ò)¨9Ñ5ˆØÒÜ Ð!@ÓAÐAÜ×$Ò$¤T¨+Ó%6¸ÓAÐAr   r/   )rT   r=   r   rQ   rS   rc   rh   s   ffffff r   Úconstruct_autograd_kernelrk   f   s   ý€ ÷/Bò /Bðb €Lr   c           
      ó~   € \        V \        P                  P                  3R \	        V4      R\	        V4      /4      pV# )rV   r   )r9   r"   r   ÚFunctionÚstaticmethod)ÚnamerV   r   ri   s   &&& r   rf   rf   ¢   s@   € ÜØÜ	�‰×	 Ñ	 Ð"à”| GÓ,Øœ XÓ.ð	
ó€Mð Ðr   c                 óº   € V P                   P                   Uu. uF  qP                  NK  	  pp\        V P                  4      R ,           p\	        W24      pV# u upi )Ú_args)Ú	argumentsÚflat_allro   Ústrr   )rT   ÚargÚattribsro   Ú	tuple_clss   &    r   Únamedtuple_args_clsrx   ®   sN   € à#)×#3Ñ#3×#<Ò#<Ó=Ñ#<˜C�xŒxÑ#<€GÐ=Üˆv�{‰{Ó˜gÕ%€Dä˜4Ó)€IØÐùò	 >s   ™Ac                 ó~   € \        V\        4      '       g   \        R \        V4       24      h\	        V 4      pV! V!  # )zexpected tuple, got )r!   r1   r3   r9   rx   )rT   r   rw   s   && r   rH   rH   ·   s;   € Ü�dœE×"Ò"ÜÐ3´D¸³J°<Ð@ÓAÐAÜ# FÓ+€IÙ�dÑÐr   c                 óæ  a€ V3R  lp\        V \        4      '       g   V! R\        V 4       24       SP                  P                  P
                   Uu0 uF1  pVP                  P                  4       '       g   K%  VP                  kK3  	  ppV P                  4       pWV8w  d   V! RV RV R24       V P                  4        EF¥  w  rx\        W'4      p	\        V	\        4      '       Ed
   \        V\        \        34      '       g   V! RV R\        V4       R24       \        V4      \        V	4      8w  d$   V! RV R\        V	4       R	\        V4       24       \        \        W‰4      4       F~  w  p
w  r¼Vf   K  \        V\         P"                  4      '       g   V! RV R\        V4       RV
 24       \%        V\         P"                  4      '       d   Kj  V! RV RV
 RV
 RV	 24       K€  	  EK1  Vf   EK8  \        V\         P"                  4      '       g   V! R\        V4       RV R24       \%        V	\         P"                  4      '       d   EK“  V! RV RV RV	 R24       EK¨  	  R
# u upi )c                 ób   <€ SP                  R 4      p\        RS RVP                   RV  24      h)r   z%In the backward function defined for r	   z using the CustomOp API, )r   r   r   )Úwhatr   Ú
forward_ops   & €r   ÚerrorÚ(validate_grad_inputs_dict.<locals>.error¿   sB   ø€ Ø×'Ñ'¨
Ó3ˆÜØ3°J°<¸tØ× Ñ Ð!Ð!:¸4¸&ðBó
ð 	
r   zBexpected the output of the backward function to be a dict but got z3expected the returned grad_input dict to have keys z	 but got zÖ. The backward function must return a gradient (can be None) for each arg to the CustomOp that may be a Tensor or Sequence[Tensor]. Args declared to be non-Tensor-like types should not appear in the grad_input dictzfor input 'zR' expected the grad_input dict to hold a list of gradients but got object of type Ú.z1' expected the grad_input dict to hold a list of z gradients but got Nz\' expected the grad_input dict to hold a list of None or Tensor gradients but got object of z
 at index z(', got a Tensor as the gradient for the z(-th value but expected None because the z(-th value was not a Tensor (it was type zgot object of type z as the gradient for input 'z:', but expected the gradient to be either None or a Tensorz(got a Tensor as the gradient for input 'z3' but expected None as the gradient because input 'z ' was not a Tensor (it was type z).)r!   Údictr9   Ú_schemarr   rs   Úis_tensor_likero   ÚkeysÚitemsÚgetattrr7   r1   r2   r4   r5   r"   r#   Ú
issubclass)rb   r}   rM   r~   ru   Úexpected_keysÚactual_keysro   ÚgradÚarg_infor@   ÚgÚinfos   &f&          r   r\   r\   ¾   sŠ  ø€ õ
ô Ð&¬×-Ò-ÙðÜÐ(Ó)Ð*ð,ô	
ð ×%Ñ%×/Ñ/×8Ò8óá8ˆCØ�8‰8×"Ñ"×$ô 	ˆ�ŒÙ8ð ð ð
 #×'Ñ'Ó)€KØÔ#ÙØAØˆo˜Y { mð 4%ð&ô	
ð '×,Ñ,×.‰
ˆÜ˜9Ó+ˆä�h¤×%Ó%Ü˜d¤U¬D M×2Ò2ÙØ! $ ð (Gä˜D“z�l !ð%ôô
 �4‹yœC ›MÔ)ÙØ! $ ð (&Ü&)¨(£m _Ð4GÜ˜4“y�kð#ôô
 #,¬C°Ó,?Ö"@‘�‘Y�aØ’9ÙÜ! !¤U§\¡\×2Ò2ÙØ% d Vð ,%ä%)¨!£W I¨Z¸°uð>ôô
 " $¬¯©×5Ô5ÙØ% d Vð ,#Ø#& %ð (Ø"˜eð $ Ø (˜zð+öñ #Aò  àŠ<ÚÜ˜$¤§¡×-Ò-ÙØ%¤d¨4£j \ð 2Ø�6ð JðKôô
 ˜(¤E§L¡L×1Õ1ÙØ:¸4¸&ð A@Ø@D¸vð F1Ø19°
¸"ð>÷óW /ùò!s   Á"I.Á;I.c                 ó  € . pVP                  4       P                  4        FK  w  r4W09  d*   VP                  \        P                  ! R  V4      4       K4  VP                  W,          4       KM  	  \        \        P                  ! V4      4      # )c                 ó   € R # r    r/   r%   s   &r   r'   Ú0grad_inputs_dict_to_flat_tuple.<locals>.<lambda>  s   € ±Dr   )Ú_asdictr…   r6   r*   rI   r1   Útree_leaves)rb   rM   Úresultro   r‹   s   &&   r   r]   r]     sm   € Ø€FØ#×+Ñ+Ó-×3Ñ3Ö5‰ˆØÔ'Ø�M‰Mœ&Ÿ/š/©.¸(ÓCÔDÙØ�‰Ð&Õ,Ö-ñ	 6ô
 ”×#Ò# FÓ+Ó,Ð,r   c                 ó   € \         P                  ! V4      w  r#\        V4      p\        V4       UUu. uF)  w  rV\	        V\
        P                  4      '       g   K'  VNK+  	  ppp\        V4       UUu. uF)  w  rV\	        V\
        P                  4      '       d   K'  VNK+  	  pppV Uu. uF'  p\	        V\
        P                  4      '       g   K%  VNK)  	  p	pV Uu. uF'  p\	        V\
        P                  4      '       d   K%  VNK)  	  p
pW0n        W@n        V P                  ! V	!   Wpn
        W n        W€n        R # u uppi u uppi u upi u upi r    )r*   rK   r2   r4   r!   r"   r#   rU   Únum_eltsr   Útensor_idxsÚsaved_non_tensorsÚnon_tensor_idxs)r;   ÚstuffÚ
flat_stuffrU   r•   r@   Úthingr–   r˜   ÚtensorsÚnon_tensorss   &&         r   rJ   rJ     s  € Ü×*Ò*¨5Ó1Ñ€JÜ�:‹€Hä'¨
Ô3ôÙ3‘
�´zÀ%ÌÏÉ×7V�ˆÑ3ð ñ ô
 $ JÔ/ôá/‰JˆCÜ˜%¤§¡×.÷ 	ˆÙ/ð ñ ñ
 #-ÓP¡*˜´
¸5Ä%Ç,Á,×0O�uˆu¡*€GÐPÙ&0ÓX¡j˜U¼
À5Ì%Ï,É,×8W—5�5¡j€KÐXà„HØ„LØ×Ò˜7Ò#Ø!„OØ'ÔØ)Öùó!ùóùò
 QùÚXs/   ²$D:ÁD:Á2$E ÂE Â("EÃEÃ"EÄEc                 ó"  € R .V P                   ,          p\        V P                  V P                  4       F	  w  r#W!V&   K  	  \        V P                  V P
                  4       F	  w  rCWAV&   K  	  \        P                  ! WP                  4      pV# r    )	r•   r5   Úsaved_tensorsr–   r—   r˜   r*   rG   rU   )r;   rš   Útensorr@   Ú
non_tensorr™   s   &     r   rZ   rZ   3  sv   € Ø�˜#Ÿ,™,Õ&€JÜ˜3×,Ñ,¨c¯o©oÖ>‰ˆØ �3‹ñ ?ä˜s×4Ñ4°c×6IÑ6IÖJ‰ˆ
Ø$�3‹ñ Kä×!Ò! *¯h©hÓ7€EØ€Lr   )Ú	functoolsÚcollectionsr   r"   Útorch.utils._pytreeÚutilsÚ_pytreer*   r   r   r:   rk   rf   Ú	lru_cacherx   rH   r\   r]   rJ   rZ   r/   r   r   Ú<module>r¨      sf   ðã Ý "ã ß $Ð $òò@	ò$EòN9òx	ð ×Ññó ðòòMò`-ò*ô.r   