o
    ,’×i×
  ã                   @   s~   U d dl mZ d dlZd dlmZ d dlmZ d dlZdaeej	 e
d< e d¡dd„ ƒZG d	d
„ d
eƒZdd„ Zdd„ ZdS )é    )ÚOptionalN)ÚTorchFunctionMode©Úcontext_decoratorÚCURRENT_DEVICEé   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© r2   r2   úQ/home/ubuntu/SoloSpeech/.venv/lib/python3.10/site-packages/torch/utils/_device.pyÚ_device_constructors
   s¢   þýüûúùø	÷
öõôóòñðïîíìéèçæåäãâá à!ß"Þ#Ý$Ü%Û&Ú'Ù)×*Ö+Õ,Ôr4   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)Úselfr6   r2   r2   r3   Ú__init__=   s   zDeviceContext.__init__c                    s   t | _| ja tƒ  ¡ S r   )r   Ú
old_devicer6   ÚsuperÚ	__enter__)r7   ©Ú	__class__r2   r3   r;   @   s   
zDeviceContext.__enter__c                    s   | j atƒ  |||¡S r   )r9   r   r:   Ú__exit__)r7   Úexc_typeÚexc_valÚexc_tbr<   r2   r3   r>   F   s   zDeviceContext.__exit__r2   Nc                 C   s8   |pi }|t ƒ v r| d¡d u r| j|d< ||i |¤ŽS )Nr6   )r4   Úgetr6   )r7   ÚfuncÚtypesÚargsÚkwargsr2   r2   r3   Ú__torch_function__K   s   
z DeviceContext.__torch_function__)r2   N)Ú__name__Ú
__module__Ú__qualname__r8   r;   r>   rG   Ú__classcell__r2   r2   r<   r3   r5   <   s
    r5   c                    s   t ‡ fdd„|ƒS )Nc                      s   ˆ S r   r2   r2   ©r6   r2   r3   Ú<lambda>S   s    z"device_decorator.<locals>.<lambda>r   )r6   rC   r2   rL   r3   Údevice_decoratorR   s   rN   c                    s   ‡ fd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                    s   t t ˆ ¡| ƒS r   )rN   r	   r6   )rC   rL   r2   r3   rM   \   s    zset_device.<locals>.<lambda>r2   rL   r2   rL   r3   Ú
set_deviceU   s   rO   )Útypingr   r	   Útorch.overridesr   Útorch.utils._contextlibr   Ú	functoolsr   r6   Ú__annotations__Ú	lru_cacher4   r5   rN   rO   r2   r2   r2   r3   Ú<module>   s   
1