o
    ÜÜÓhy
  ã                   @   sb   d dl Z d dlmZ d dlmZ d dlZdae d¡dd„ ƒZG dd„ deƒZ	d	d
„ Z
dd„ ZdS )é    N)ÚTorchFunctionMode©Úcontext_decoratoré   c                   C   sú   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’t jj’t j’t j’t j’t j’t j’t j’t j’t j’t j’t j’t j’t j ’t j!’t j"’t j#’t j$’t j%’t j&’t j'’t j(’t j%’S ©N))ÚtorchÚemptyÚempty_permutedÚempty_stridedÚempty_quantizedÚonesÚarangeÚbartlett_windowÚblackman_windowÚeyeÚfftÚfftfreqÚrfftfreqÚfullÚfillÚ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ÚvanderÚzerosÚasarrayÚtensorÚ	as_tensorÚscalar_tensor© r0   r0   úI/var/www/html/ai/venv/lib/python3.10/site-packages/torch/utils/_device.pyÚ_device_constructors   s¢   þýüûúùø	÷
öõôóòñðïîíìéèçæåäãâá à!ß"Þ#Ý$Ü%Û&Ú'Ù)×*Ö+Õ,Ôr2   c                       s:   e Zd Zdd„ Z‡ fdd„Z‡ fdd„Zdd	d
„Z‡  ZS )ÚDeviceContextc                 C   s   t  |¡| _d S r   )r   Údevice)Úselfr4   r0   r0   r1   Ú__init__;   s   zDeviceContext.__init__c                    s   t | _| ja tƒ  ¡ S r   )ÚCURRENT_DEVICEÚ
old_devicer4   ÚsuperÚ	__enter__)r5   ©Ú	__class__r0   r1   r:   >   s   
zDeviceContext.__enter__c                    s   | j atƒ  |||¡S r   )r8   r7   r9   Ú__exit__)r5   Úexc_typeÚexc_valÚexc_tbr;   r0   r1   r=   D   s   zDeviceContext.__exit__r0   Nc                 C   s8   |pi }|t ƒ v r| d¡d u r| j|d< ||i |¤ŽS )Nr4   )r2   Úgetr4   )r5   ÚfuncÚtypesÚargsÚkwargsr0   r0   r1   Ú__torch_function__I   s   
z DeviceContext.__torch_function__)r0   N)Ú__name__Ú
__module__Ú__qualname__r6   r:   r=   rF   Ú__classcell__r0   r0   r;   r1   r3   :   s
    r3   c                    s   t ‡ fdd„|ƒS )Nc                      s   ˆ S r   r0   r0   ©r4   r0   r1   Ú<lambda>Q   s    z"device_decorator.<locals>.<lambda>r   )r4   rB   r0   rK   r1   Údevice_decoratorP   s   rM   c                    s   ‡ fdd„S )zá
    Decorator which sets the default device inside of the wrapped
    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                    s   t t ˆ ¡| ƒS r   )rM   r   r4   )rB   rK   r0   r1   rL   Z   s    zset_device.<locals>.<lambda>r0   rK   r0   rK   r1   Ú
set_deviceS   s   rN   )r   Útorch.overridesr   Útorch.utils._contextlibr   Ú	functoolsr7   Ú	lru_cacher2   r3   rM   rN   r0   r0   r0   r1   Ú<module>   s    
1