This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch v0.6
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/v0.6 by this push:
     new b2a2d2a  [BACKPORT-0.6][BUGFIX] Fix search path for libtvm_topi.so 
(#5836)
b2a2d2a is described below

commit b2a2d2a3b52a353c10931410ffe2e03c3fb6c51d
Author: Junru Shao <[email protected]>
AuthorDate: Wed Jun 17 13:44:14 2020 -0700

    [BACKPORT-0.6][BUGFIX] Fix search path for libtvm_topi.so (#5836)
---
 python/tvm/_ffi/libinfo.py   | 4 ++--
 topi/python/topi/cpp/impl.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/python/tvm/_ffi/libinfo.py b/python/tvm/_ffi/libinfo.py
index f1ca894..b7b0c8f 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 5eff604..9ae407d 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

Reply via email to