a
    /Sicä  ã                   @   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   ÚTFE_NewCancellationManagerr   ©Úself© r	   ú`/var/www/html/django/DPS/env/lib/python3.9/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   Ú"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   Ú"TFE_CancellationManagerStartCancelr   r   r	   r	   r
   Ústart_cancel!   s    z CancellationManager.start_cancelc                 C   s
   |  | ¡S r   )Ú'_experimental_with_cancellation_manager)r   Ú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   Útensorflow.pythonr   Úobjectr   r	   r	   r	   r
   Ú<module>   s   