Returns the default session for the current thread.
tf.compat.v1.get_default_session()
The returned Session
will be the innermost session on which a Session
or Session.as_default()
context has been entered.
Note: The default session is a property of the current thread. If you create a new thread, and wish to use the default session in that thread, you must explicitly add a with sess.as_default():
in that thread's function.
Returns | |
---|---|
The default Session being used in the current thread. |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.4/api_docs/python/tf/compat/v1/get_default_session