diff --git a/python/tvm/_ffi/libinfo.py b/python/tvm/_ffi/libinfo.py index f1ca89409821..b7b0c8f8e844 100644 --- a/python/tvm/_ffi/libinfo.py +++ b/python/tvm/_ffi/libinfo.py @@ -90,7 +90,7 @@ def find_lib_path(name=None, search_path=None, optional=False): dll_path = [os.path.realpath(x) for x in dll_path] if search_path is not None: - if search_path is list: + if isinstance(search_path, list): dll_path = dll_path + search_path else: dll_path.append(search_path) @@ -167,7 +167,7 @@ def find_include_path(name=None, search_path=None, optional=False): header_path = [os.path.abspath(x) for x in header_path] if search_path is not None: - if search_path is list: + if isinstance(search_path, list): header_path = header_path + search_path else: header_path.append(search_path) diff --git a/topi/python/topi/cpp/impl.py b/topi/python/topi/cpp/impl.py index 5eff6040a66e..9ae407d4bd12 100644 --- a/topi/python/topi/cpp/impl.py +++ b/topi/python/topi/cpp/impl.py @@ -32,7 +32,7 @@ def _get_lib_names(): def _load_lib(): """Load libary by searching possible path.""" curr_path = os.path.dirname(os.path.realpath(os.path.expanduser(__file__))) - lib_search = curr_path + lib_search = [curr_path, os.path.dirname(curr_path)] lib_path = libinfo.find_lib_path(_get_lib_names(), lib_search, optional=True) if lib_path is None: return None, None