MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / get_session

Function get_session

tensorflow/python/keras/backend.py:461–487  ·  view source on GitHub ↗

Returns the TF session to be used by the backend. 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.

(op_input_list=())

Source from the content-addressed store, hash-verified

459
460@keras_export(v1=['keras.backend.get_session'])
461def get_session(op_input_list=()):
462 """Returns the TF session to be used by the backend.
463
464 If a default TensorFlow session is available, we will return it.
465
466 Else, we will return the global Keras session assuming it matches
467 the current graph.
468
469 If no global Keras session exists at this point:
470 we will create a new global session.
471
472 Note that you can manually set the global session
473 via `K.set_session(sess)`.
474
475 Arguments:
476 op_input_list: An option sequence of tensors or ops, which will be used
477 to determine the current graph. Otherwise the default graph will be
478 used.
479
480 Returns:
481 A TensorFlow session.
482 """
483 session = _get_session(op_input_list)
484 if not _MANUAL_VAR_INIT:
485 with session.graph.as_default():
486 _initialize_variables(session)
487 return session
488
489
490def get_graph():

Callers 6

_get_available_gpusFunction · 0.70
get_valueFunction · 0.70
batch_get_valueFunction · 0.70
set_valueFunction · 0.70
batch_set_valueFunction · 0.70
__call__Method · 0.70

Calls 3

_get_sessionFunction · 0.85
_initialize_variablesFunction · 0.85
as_defaultMethod · 0.45

Tested by

no test coverage detected