Ë
    g^(hÜ	  ã            
       óÔ  — d dl Z d dlmZ d dlmZ d dlmZ d dlZdj                  «       Z	 G d„ dej                  j                  «      Zdej                  d	ej                  j                  d
ej                  j                  fd„Zdeedf   dej&                  dej(                  ded
ej                  j                  f
d„Z e j.                  «       Zed
eeddf   fd„«       Zd
efd„Zy)é    N)Ú	Generator)Úcontextmanager)ÚAnya   
This is used when dynamo traces torch.nn.Parameter, which normally would not trace properly
with AOTAutograd.  We instead create a placeholder torch.nn.Parameter before the graph, which
becomes a graph arg and has no storage backing it.  At the point in the graph where the parameter
actually should be created we mutate this sacrificial placeholder into it.  This allows gradients
to flow into the parameter as if it were an input to the graph (which is the only thing we are
allowed to compute gradients on).
c            	       ó¦   — e Zd Zededededej                  j                  fd„«       Zededej                  de
dej                  f   fd„«       Zy)	ÚTracableCreateParameterÚctxÚtensorÚplaceholderÚreturnc                 ó@   — |j                   rJ ‚|j                  |«      S ©N)Úrequires_gradÚset_)r   r	   r
   s      ú_/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/torch/_dynamo/create_parameter_op.pyÚforwardzTracableCreateParameter.forward   s"   € à×'Ò'Ð'Ð'Ø×Ñ Ó'Ð'ó    Úgrad_outputsNc                 ó   — |d   }d |fS )Nr   © )r   r   Úgrads      r   Úbackwardz TracableCreateParameter.backward   s   € à˜A‰ˆØ�TˆzÐr   )Ú__name__Ú
__module__Ú__qualname__Ústaticmethodr   ÚtorchÚnnÚ	Parameterr   ÚTensorÚtupler   r   r   r   r   r      su   „ Øð(�Sð ( #ð (°Cð (¸E¿H¹H×<NÑ<Nò (ó ð(ð ð�cð ¨%¯,©,ð ¸5ÀÀuÇ|Á|ÐASÑ;Tò ó ñr   r   r	   r
   r   c                 óœ   — t        j                  |j                  «      5  t        j	                  | |«      }d d d «       |S # 1 sw Y   S xY wr   )r   Úset_grad_enabledr   r   Úapply)r	   r
   Úouts      r   Útracable_create_parameterr%   !   sG   € ô 
×	Ñ	 × 9Ñ 9Ó	:ñ AÜ%×+Ñ+¨F°KÓ@ˆ÷Aà€J÷Aà€Jús    AÁAÚsize.ÚdtypeÚdevicer   c                 ó²   — t         j                  j                  t        j                  | ||¬«      |¬«      }|j	                  «       j                  d«       |S )z8Create a placeholder to be passed to the above functions)r'   r(   )r   r   )r   r   r   ÚemptyÚuntyped_storageÚresize_)r&   r'   r(   r   Úresults        r   Únew_parameter_placeholderr.   )   sM   € ô �X‰X×ÑÜ�‰�D ¨fÔ5À]ð  ó €Fð
 ×ÑÓ×$Ñ$ QÔ'Ø€Mr   c               #   ó„   K  — t        t        dd«      } dt        _        	 d–— | t        _        y # | t        _        w xY w­w)NÚconvert_tracable_parameterTF)ÚgetattrÚ_TLSr0   )Úold_flags    r   Ú$do_not_convert_to_tracable_parameterr4   9   s7   è ø€ ä”tÐ9¸4Ó@€HØ&+„DÔ#ð3ØŠà*2ŒÕ'ø¨(ŒÕ'üs   ‚A  0 ¤A °=½A c                  ó$   — t        t        dd«      S )Nr0   T)r1   r2   r   r   r   Ú!can_convert_to_tracable_parameterr6   C   s   € Ü”4Ð5°tÓ<Ð<r   )Ú	threadingÚcollections.abcr   Ú
contextlibr   Útypingr   r   ÚstripÚdocÚautogradÚFunctionr   r   r   r   r%   r    Úintr'   r(   Úboolr.   Úlocalr2   r4   r6   r   r   r   ú<module>rB      sü   ðÛ Ý %Ý %Ý ã ð
÷ 
�EƒGð ô	˜eŸn™n×5Ñ5ô 	ðØ�L‰LðØ',§x¡x×'9Ñ'9ðà
‡X�X×Ñóð
Ø
��S�‰/ð
Ø"'§+¡+ð
Ø7<·|±|ð
ØTXð
à
‡X�X×Ñó
ð €y‡�Ó€ð ð3¨i¸¸dÀDÐ8HÑ.Iò 3ó ð3ð=¨4ô =r   