Ë
    S²j‹  ã                   ó¼   — U d dl Z d dlZd dlmZ d dlmZmZmZ d dlm	Z	 da
ej                  dz  ed<    e j                  d«      d„ «       Z G d„ d	e«      Zd
„ Zd„ Zy)é    N)Ú_len_torch_function_stack)Ú	_pop_modeÚ
_push_modeÚTorchFunctionMode©Úcontext_decoratorÚCURRENT_DEVICEé   c                  óÂ  — h t         j                  ’t         j                  ’t         j                  ’t         j                  ’t         j
                  ’t         j                  ’t         j                  ’t         j                  ’t         j                  ’t         j                  j                  ’t         j                  j                  ’t         j                  ’t         j                  ’t         j                  ’t         j                   ’t         j"                  ’t         j$                  ’t         j&                  j(                  ’t         j*                  ’t         j,                  ’t         j.                  ’t         j0                  ’t         j2                  ’t         j4                  ’t         j6                  ’t         j8                  ’t         j:                  ’t         j<                  ’t         j>                  ’t         j@                  ’t         jB                  ’t         jD                  ’t         jF                  ’t         jH                  ’t         jJ                  ’t         jL                  ’S ©N)'ÚtorchÚemptyÚempty_permutedÚempty_stridedÚempty_quantizedÚonesÚarangeÚbartlett_windowÚblackman_windowÚeyeÚfftÚfftfreqÚrfftfreqÚfullÚhamming_windowÚhann_windowÚkaiser_windowÚlinspaceÚlogspaceÚnestedÚnested_tensorÚrandÚrandnÚrandintÚrandpermÚrangeÚsparse_coo_tensorÚsparse_compressed_tensorÚsparse_csr_tensorÚsparse_csc_tensorÚsparse_bsr_tensorÚsparse_bsc_tensorÚtril_indicesÚtriu_indicesÚzerosÚasarrayÚtensorÚ	as_tensorÚscalar_tensor© ó    úR/var/www/html/ia-enhanced/venv/lib/python3.12/site-packages/torch/utils/_device.pyÚ_device_constructorsr7      sF  € ð1ä�‰ð1ô 	×Ñð1ô 	×Ñð	1ô
 	×Ñð1ô 	�
‰
ð1ô 	�‰ð1ô 	×Ñð1ô 	×Ñð1ô 	�	‰	ð1ô 	�	‰	×Ñð1ô 	�	‰	×Ñð1ô 	�
‰
ð1ô 	×Ñð1ô 	×Ñð1ô  	×Ñð!1ô" 	�‰ð#1ô$ 	�‰ð%1ô& 	�‰×"Ñ"ð'1ô, 	�
‰
ð-1ô. 	�‰ð/1ô0 	�‰ð11ô2 	�‰ð31ô4 	�‰ð51ô6 	×Ñð71ô8 	×&Ñ&ð91ô: 	×Ñð;1ô< 	×Ñð=1ô> 	×Ñð?1ô@ 	×ÑðA1ôB 	×ÑðC1ôD 	×ÑðE1ôF 	�‰ðG1ôH 	�‰ðI1ôL 	�‰ðM1ôN 	�‰ðO1ôP 	×ÑðQ1ð 1r5   c                   ó(   — e Zd Zdd„Zd„ Zd„ Zdd„Zy)ÚDeviceContextNc                 óF   — t        j                  |«      | _        d | _        y r   )r   ÚdeviceÚ	prev_mode)Úselfr;   s     r6   Ú__init__zDeviceContext.__init__E   s   € Ü—l‘l 6Ó*ˆŒØ/3ˆ�r5   c                 ó  — t         | _        | j                  a t        t	        «       «      D �cg c]  }t        «       ‘Œ }}t        | «       t        |«      D ]%  }t        |t        «      r|| _
        Œt        |«       Œ' y c c}w r   )r	   Ú
old_devicer;   r&   r   r   r   ÚreversedÚ
isinstancer9   r<   )r=   Ú_Ú	cur_stackÚmodes       r6   Ú	__enter__zDeviceContext.__enter__I   sm   € ä(ˆŒØŸ™ˆô
 +0Ô0IÓ0KÓ*LÖM Q”Y•[ÐMˆ	ÐMä�4Ôä˜YÓ'ò 	!ˆDÜ˜$¤Ô.Ø!%�•ä˜4Õ ñ		!ùò	 Ns   ­A?c                 óž  — | j                   ag }t        t        «       dz
  «      D ]8  }t	        «       }t        |t        «      rt        d«      ‚|j                  |«       Œ: t        «       dkD  r%t	        «       }t        |t        «      st        d«      ‚| j                  �t        | j                  «       t        |«      D ]  }t        |«       Œ y )Nr
   z@Found nested DeviceContext on the mode stack where none expectedr   z8Expected a DeviceContext at the bottom of the mode stack)r@   r	   r&   r   r   rB   r9   ÚAssertionErrorÚappendr<   r   rA   )r=   Úexc_typeÚexc_valÚexc_tbrD   rC   rE   s          r6   Ú__exit__zDeviceContext.__exit__[   sÂ   € àŸ™ˆØˆ	ô Ô0Ó2°QÑ6Ó7ò 	#ˆAÜ“;ˆDÜ˜$¤Ô.Ü$ØVóð ð ×Ñ˜TÕ"ð	#ô %Ó&¨Ò*Ü“;ˆDÜ˜d¤MÔ2Ü$ØNóð ð �>‰>Ð%Ü�t—~‘~Ô&ä˜YÓ'ò 	ˆDÜ�tÕñ	r5   c                 óv   — |xs i }|t        «       v r |j                  d«      €| j                  |d<    ||i |¤ŽS )Nr;   )r7   Úgetr;   )r=   ÚfuncÚtypesÚargsÚkwargss        r6   Ú__torch_function__z DeviceContext.__torch_function__v   sC   € Ø’˜2ˆØÔ'Ó)Ñ)¨f¯j©j¸Ó.BÐ.JØ#Ÿ{™{ˆF�8ÑÙ�TÐ$˜VÑ$Ð$r5   )ÚreturnN)r4   N)Ú__name__Ú
__module__Ú__qualname__r>   rF   rM   rT   r4   r5   r6   r9   r9   D   s   „ ó4ò!ò$ô6%r5   r9   c                 ó"   ‡ — t        ˆ fd„|«      S )Nc                  ó   •— ‰ S r   r4   ©r;   s   €r6   ú<lambda>z"device_decorator.<locals>.<lambda>   s   ø€  V€ r5   r   )r;   rP   s   ` r6   Údevice_decoratorr]   ~   s   ø€ Ü›^¨TÓ2Ð2r5   c                 ó   ‡ — ˆ fd„S )zð
    Set the default device inside of the wrapped function by decorating it with this function.

    If you would like to use this as a context manager, use device as a
    context manager directly, e.g., ``with torch.device(device)``.
    c                 óB   •— t        t        j                  ‰«      | «      S r   )r]   r   r;   )rP   r;   s    €r6   r\   zset_device.<locals>.<lambda>‰   s   ø€ Ô(¬¯©°fÓ)=¸tÓD€ r5   r4   r[   s   `r6   Ú
set_devicer`   ‚   s   ø€ ó EÐDr5   )Ú	functoolsr   Útorch._Cr   Útorch.overridesr   r   r   Útorch.utils._contextlibr   r	   r;   Ú__annotations__Ú	lru_cacher7   r9   r]   r`   r4   r5   r6   ú<module>rg      sg   ðä ã Ý .ß DÑ DÝ 5ð '+€�—‘˜tÑ#Ó *ð €×Ñ�QÓñ2ó ð2ôl6%Ð%ô 6%òt3óEr5   