U
    ‰dp  ã                   @   sF   d dl Z d dlmZ G dd„ deƒZee jje jjf dœdd„ZdS )é    N)ÚUnionc                   @   s@   e Zd Zejjeejjejjf dœdd„Z	dd„ Z
dd„ ZdS )	Ú_InsertPoint)Úinsert_point_graphÚinsert_pointc                 C   s   || _ || _d | _d S ©N)r   ÚgZguard)Úselfr   r   © r	   ú7/tmp/pip-unpacked-wheel-ua33x9lu/torch/jit/_ir_utils.pyÚ__init__   s    z_InsertPoint.__init__c                 C   s   | j  ¡ | _| j  | j¡ d S r   )r   ZinsertPointÚprev_insert_pointÚsetInsertPointr   )r   r	   r	   r
   Ú	__enter__
   s    z_InsertPoint.__enter__c                 G   s   | j  | j¡ d S r   )r   r   r   )r   Úargsr	   r	   r
   Ú__exit__   s    z_InsertPoint.__exit__N)Ú__name__Ú
__module__Ú__qualname__ÚtorchÚ_CZGraphr   ÚNodeÚBlockr   r   r   r	   r	   r	   r
   r      s   $r   )r   c                 C   s
   t | |ƒS r   )r   )r   r   r	   r	   r
   Úinsert_point_guard   s    r   )	r   Útypingr   Úobjectr   r   r   r   r   r	   r	   r	   r
   Ú<module>   s   