U
    5Ç-e+  ã                   @   sv   d dl Z d dlmZ d dlmZmZ G dd„ de jƒZeƒ Ze	dœdd„Z
e	dœd	d
„Zee	e	ed dœdd„ƒZdS )é    N)Úcontextmanager)ÚIteratorÚOptionalc                   @   s.   e Zd ZU dZee ed< dZee ed< dS )ÚLocalsNÚ!use_const_ref_for_mutable_tensorsÚuse_ilistref_for_tensor_lists)Ú__name__Ú
__module__Ú__qualname__r   r   ÚboolÚ__annotations__r   © r   r   úO/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/torchgen/local.pyr      s   
r   )Úreturnc                   C   s   t jd k	stdƒ‚t jS )NzQneed to initialize local.use_const_ref_for_mutable_tensors with local.parametrize)Ú_localsr   ÚAssertionErrorr   r   r   r   r      s    ÿr   c                   C   s   t jd k	stdƒ‚t jS )NzMneed to initialize local.use_ilistref_for_tensor_lists with local.parametrize)r   r   r   r   r   r   r   r   "   s    ÿr   )r   r   r   c                 c   s6   t j}t j}z| t _|t _d V  W 5 |t _|t _X d S )N)r   r   r   )r   r   Z%old_use_const_ref_for_mutable_tensorsZ!old_use_ilistref_for_tensor_listsr   r   r   Úparametrize*   s    
ÿr   )Ú	threadingÚ
contextlibr   Útypingr   r   Úlocalr   r   r   r   r   r   r   r   r   r   Ú<module>   s    þ