Commit 12d1ab5a by Tianqi Chen Committed by GitHub

[RUNTIME] More reliable runtime only detection (#914)

* [RUNTIME] More reliable runtime only detection

* fix lint
parent 6bf3a9d4
......@@ -41,6 +41,10 @@ def _load_lib():
__version__ = libinfo.__version__
# library instance of nnvm
_LIB, _LIB_NAME = _load_lib()
# Whether we are runtime only
_RUNTIME_ONLY = "runtime" in _LIB_NAME
# The FFI mode of TVM
_FFI_MODE = os.environ.get("TVM_FFI", "auto")
......
......@@ -6,9 +6,9 @@ LoweredFunc and compiled Module.
from __future__ import absolute_import as _abs
import warnings
import types
import os
from ._ffi.node import NodeBase, register_node
from ._ffi.base import _RUNTIME_ONLY
from . import api
from . import tensor
from . import schedule
......@@ -226,7 +226,7 @@ def build_config(**kwargs):
setattr(config, k, kwargs[k])
return config
if not os.environ.get("TVM_USE_RUNTIME_LIB", False):
if not _RUNTIME_ONLY:
# BuildConfig is not available in tvm_runtime
BuildConfig.current = build_config()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment