def _load_pyfunc(path):
    '\n    Load PyFunc implementation. Called by ``pyfunc.load_pyfunc``.\n\n    :param path: Local filesystem path to the MLflow Model with the ``keras`` flavor.\n    '
    import tensorflow as tf
    if os.path.isfile(os.path.join(path, _KERAS_MODULE_SPEC_PATH)):
        with open(os.path.join(path, _KERAS_MODULE_SPEC_PATH), 'r') as f:
            keras_module = importlib.import_module(f.read())
    else:
        import keras
        keras_module = keras
    K = importlib.import_module((keras_module.__name__ + '.backend'))
    if ((keras_module.__name__ == 'tensorflow.keras') or (K.backend() == 'tensorflow')):
        if (LooseVersion(tf.__version__) < LooseVersion('2.0.0')):
            graph = tf.Graph()
            sess = tf.Session(graph=graph)
            with graph.as_default():
                with sess.as_default():
                    K.set_learning_phase(0)
                    m = _load_model(path, keras_module=keras_module, compile=False)
                    return _KerasModelWrapper(m, graph, sess)
        else:
            K.set_learning_phase(0)
            m = _load_model(path, keras_module=keras_module, compile=False)
            return _KerasModelWrapper(m, None, None)
    else:
        raise MlflowException(("Unsupported backend '%s'" % K._BACKEND))
Load PyFunc implementation. Called by ``pyfunc.load_pyfunc``.

:param path: Local filesystem path to the MLflow Model with the ``keras`` flavor.
def _load_pyfunc(path):
    '\n    Load PyFunc implementation. Called by ``pyfunc.load_pyfunc``.\n\n    :param path: Local filesystem path to the MLflow Model with the ``keras`` flavor.\n    '
    import tensorflow as tf
    if os.path.isfile(os.path.join(path, _KERAS_MODULE_SPEC_PATH)):
        with open(os.path.join(path, _KERAS_MODULE_SPEC_PATH), 'r') as f:
            keras_module = importlib.import_module(f.read())
    else:
        import keras
        keras_module = keras
    K = importlib.import_module((keras_module.__name__ + '.backend'))
    if ((keras_module.__name__ == 'tensorflow.keras') or (K.backend() == 'tensorflow')):
        if (LooseVersion(tf.__version__) < LooseVersion('2.0.0')):
            graph = tf.Graph()
            sess = tf.Session(graph=graph)
            with graph.as_default():
                with sess.as_default():
                    K.set_learning_phase(0)
                    m = _load_model(path, keras_module=keras_module, compile=False)
                    return _KerasModelWrapper(m, graph, sess)
        else:
            K.set_learning_phase(0)
            m = _load_model(path, keras_module=keras_module, compile=False)
            return _KerasModelWrapper(m, None, None)
    else:
        raise MlflowException(("Unsupported backend '%s'" % K._BACKEND))