U
    <ºc}  ã                   @   s@   d dl Z d dlmZ d dlmZ edƒZdd„ Zedd„ ƒZdS )	é    N)ÚTypeVar)ÚcontextmanagerÚTc                    s   t t‡ fdd„ˆ D ƒƒƒS )Nc                 3   s   | ]}|ˆ d  kV  qdS )r   N© )Ú.0Úmode©Úmodesr   ú;/tmp/pip-unpacked-wheel-gikjz4vx/torch/utils/_mode_utils.pyÚ	<genexpr>	   s     z all_same_mode.<locals>.<genexpr>)ÚallÚtupler   r   r   r
   Úall_same_mode   s    r   c                  c   s   t j ¡ } z
d V  W 5 ~ X d S )N)ÚtorchZ_CZ_DisableTorchDispatch)Zguardr   r   r
   Úno_dispatch   s    

r   )r   Útypingr   Ú
contextlibr   r   r   r   r   r   r   r
   Ú<module>   s   