tf.keras.backend.get_session
Stay organized with collections
Save and categorize content based on your preferences.
Returns the TF session to be used by the backend.
tf.keras.backend.get_session(
op_input_list=()
)
If a default TensorFlow session is available, we will return it.
Else, we will return the global Keras session assuming it matches
the current graph.
If no global Keras session exists at this point:
we will create a new global session.
Note that you can manually set the global session
via K.set_session(sess)
.
Arguments |
op_input_list
|
An option sequence of tensors or ops, which will be used
to determine the current graph. Otherwise the default graph will be
used.
|
Returns |
A TensorFlow session.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.backend.get_session\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/keras/backend.py#L460-L487) |\n\nReturns the TF session to be used by the backend.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.backend.get_session`](/api_docs/python/tf/compat/v1/keras/backend/get_session)\n\n\u003cbr /\u003e\n\n tf.keras.backend.get_session(\n op_input_list=()\n )\n\nIf a default TensorFlow session is available, we will return it.\n\nElse, we will return the global Keras session assuming it matches\nthe current graph.\n\nIf no global Keras session exists at this point:\nwe will create a new global session.\n\nNote that you can manually set the global session\nvia `K.set_session(sess)`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `op_input_list` | An option sequence of tensors or ops, which will be used to determine the current graph. Otherwise the default graph will be used. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A TensorFlow session. ||\n\n\u003cbr /\u003e"]]