o
    IÆ&iÐ  ã                   @   s,   d dl Z ddlmZ G dd„ dƒZeƒ ZdS )é    Né   )ÚExactWeakKeyDictionaryc                   @   sL   e Zd Zdd„ Zdejfdd„Zdejfdd„Zdejfdd	„Zd
d„ Z	dS )ÚCodeContextDictc                 C   s   t ƒ | _d S ©N)r   Úcode_context©Úself© r	   úEC:\wamp64\www\opt\env\Lib\site-packages\torch/_dynamo/code_context.pyÚ__init__   s   zCodeContextDict.__init__Úcodec                 C   s
   || j v S r   )r   )r   r   r	   r	   r
   Úhas_context
   s   
zCodeContextDict.has_contextc                 C   s&   | j  |¡}|d u ri }|| j |< |S r   )r   Úget©r   r   Úctxr	   r	   r
   Úget_context   s
   
zCodeContextDict.get_contextc                 C   s   |   |¡}| j t|ƒ¡ |S r   )r   r   Z
_remove_idÚidr   r	   r	   r
   Úpop_context   s   
zCodeContextDict.pop_contextc                 C   s   | j  ¡  d S r   )r   Úclearr   r	   r	   r
   r      s   zCodeContextDict.clearN)
Ú__name__Ú
__module__Ú__qualname__r   ÚtypesÚCodeTyper   r   r   r   r	   r	   r	   r
   r      s    r   )r   Úutilsr   r   r   r	   r	   r	   r
   Ú<module>   s    
