deeppavlov/core/models/tf_backend.py
def _keras_wrap(func, graph, session):
    """Constructs function encapsulated in the graph and the session."""
    import keras.backend as K

    @wraps(func)
    def _wrapped(*args, **kwargs):
        with graph.as_default():
            K.set_session(session)
            return func(*args, **kwargs)
    return _wrapped
def _keras_wrap(func, graph, session):
    import keras.backend as K

    @wraps(func)
    def _wrapped(*args, **kwargs):
        with graph.as_default():
            K.set_session(session)
            return func(*args, **kwargs)
    return _wrapped
def _keras_wrap ( func , graph , session ) : import keras . backend as K @ wraps ( func ) def _wrapped ( * args , * * kwargs ) : with graph . as_default ( ) : K . set_session ( session ) return func ( * args , * * kwargs ) return _wrapped
Constructs function encapsulated in the graph and the session.
Constructs function encapsulated in the graph and the session .