o
    Ïe  ã                   @   s$   d Z ddlmZ G dd„ deƒZdS )z)Cancellation support for eager execution.é    )Ú
pywrap_tfec                   @   s:   e Zd ZdZdgZdd„ Zedd„ ƒZdd„ Zd	d
„ Z	dS )ÚCancellationManagerz0A mechanism for cancelling blocking computation.Ú_implc                 C   s   t  ¡ | _d S ©N)r   ZTFE_NewCancellationManagerr   ©Úself© r   úTD:\Projects\ConvertPro\env\Lib\site-packages\tensorflow/python/eager/cancellation.pyÚ__init__   s   zCancellationManager.__init__c                 C   s   t  | j¡S )zEReturns `True` if `CancellationManager.start_cancel` has been called.)r   Z"TFE_CancellationManagerIsCancelledr   r   r   r   r	   Úis_cancelled   s   z CancellationManager.is_cancelledc                 C   s   t  | j¡ dS )zGCancels blocking operations that have been registered with this object.N)r   Z"TFE_CancellationManagerStartCancelr   r   r   r   r	   Ústart_cancel!   s   z CancellationManager.start_cancelc                 C   s
   |  | ¡S r   )Z'_experimental_with_cancellation_manager)r   Zconcrete_functionr   r   r	   Úget_cancelable_function%   s   
z+CancellationManager.get_cancelable_functionN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r
   Úpropertyr   r   r   r   r   r   r	   r      s    
r   N)r   Ztensorflow.pythonr   Úobjectr   r   r   r   r	   Ú<module>   s   