Python tensorflow.python.pywrap_tensorflow.TF_CloseDeprecatedSession() Examples

The following are 5 code examples of tensorflow.python.pywrap_tensorflow.TF_CloseDeprecatedSession(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module tensorflow.python.pywrap_tensorflow , or try the search function .
Example #1
Source File: session.py    From Serverless-Deep-Learning-with-TensorFlow-and-AWS-Lambda with MIT License 6 votes vote down vote up
def close(self):
    """Closes this session.

    Calling this method frees all resources associated with the session.

    Raises:
      tf.errors.OpError: Or one of its subclasses if an error occurs while
        closing the TensorFlow session.
    """
    if self._created_with_new_api:
      if self._session and not self._closed:
        self._closed = True
        with errors.raise_exception_on_not_ok_status() as status:
          tf_session.TF_CloseSession(self._session, status)

    else:
      with self._extend_lock:
        if self._opened and not self._closed:
          self._closed = True
          with errors.raise_exception_on_not_ok_status() as status:
            tf_session.TF_CloseDeprecatedSession(self._session, status) 
Example #2
Source File: session.py    From lambda-packs with MIT License 5 votes vote down vote up
def close(self):
    """Closes this session.

    Calling this method frees all resources associated with the session.

    Raises:
      tf.errors.OpError: Or one of its subclasses if an error occurs while
        closing the TensorFlow session.
    """
    with self._extend_lock:
      if self._opened and not self._closed:
        self._closed = True
        with errors.raise_exception_on_not_ok_status() as status:
          tf_session.TF_CloseDeprecatedSession(self._session, status) 
Example #3
Source File: session.py    From auto-alt-text-lambda-api with MIT License 5 votes vote down vote up
def close(self):
    """Closes this session.

    Calling this method frees all resources associated with the session.

    Raises:
      tf.errors.OpError: Or one of its subclasses if an error occurs while
        closing the TensorFlow session.
    """
    with self._extend_lock:
      if self._opened and not self._closed:
        self._closed = True
        with errors.raise_exception_on_not_ok_status() as status:
          tf_session.TF_CloseDeprecatedSession(self._session, status) 
Example #4
Source File: session.py    From deep_image_model with Apache License 2.0 5 votes vote down vote up
def close(self):
    """Closes this session.

    Calling this method frees all resources associated with the session.

    Raises:
      tf.errors.OpError: Or one of its subclasses if an error occurs while
        closing the TensorFlow session.
    """
    with self._extend_lock:
      if self._opened and not self._closed:
        self._closed = True
        with errors.raise_exception_on_not_ok_status() as status:
          tf_session.TF_CloseDeprecatedSession(self._session, status) 
Example #5
Source File: session.py    From keras-lambda with MIT License 5 votes vote down vote up
def close(self):
    """Closes this session.

    Calling this method frees all resources associated with the session.

    Raises:
      tf.errors.OpError: Or one of its subclasses if an error occurs while
        closing the TensorFlow session.
    """
    with self._extend_lock:
      if self._opened and not self._closed:
        self._closed = True
        with errors.raise_exception_on_not_ok_status() as status:
          tf_session.TF_CloseDeprecatedSession(self._session, status)