

def get_session():
    'Returns the TF session to be used by the backend.\n\n    If a default TensorFlow session is available, we will return it.\n\n    Else, we will return the global Keras session.\n\n    If no global Keras session exists at this point:\n    we will create a new global session.\n\n    Note that you can manually set the global session\n    via `K.set_session(sess)`.\n    '
    global _SESSION
    if (tf.get_default_session() is not None):
        return tf.get_default_session()
    if (_SESSION is None):
        if (not os.environ.get('OMP_NUM_THREADS')):
            _SESSION = tf.Session(config=tf.ConfigProto(allow_soft_placement=True))
        else:
            nb_thread = int(os.environ.get('OMP_NUM_THREADS'))
            _SESSION = tf.Session(config=tf.ConfigProto(intra_op_parallelism_threads=_SESSION, allow_soft_placement=True))
    return _SESSION

dataset/ETHPy150Open fchollet/keras/keras/backend/tensorflow_backend.py get_session/VarMisuse@111/305 `nb_thread`->`_SESSION`