예제 #1
0
 def __del__(self):
   try:
     if self._context_handle is not None:
       with errors.raise_exception_on_not_ok_status() as status:
         pywrap_tensorflow.TFE_DeleteContext(self._context_handle, status)
   except (AttributeError, TypeError):
     # Sometimes deletion during program shutdown throws exception as other
     # modules are no longer available.
     pass
예제 #2
0
 def __del__(self):
     if self._handle is not None:
         with errors.raise_exception_on_not_ok_status() as status:
             pywrap_tensorflow.TFE_DeleteContext(self._handle, status)