Commit 2e15a969 authored by matthijs's avatar matthijs

port to python 3

parent 86043e78
...@@ -131,7 +131,7 @@ INLINE_INHERITED_MEMB = NO ...@@ -131,7 +131,7 @@ INLINE_INHERITED_MEMB = NO
# shortest path that makes the file name unique will be used # shortest path that makes the file name unique will be used
# The default value is: YES. # The default value is: YES.
FULL_PATH_NAMES = YES FULL_PATH_NAMES = NO
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
# Stripping is only done if one of the specified strings matches the left-hand # Stripping is only done if one of the specified strings matches the left-hand
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
# This source code is licensed under the CC-by-NC license found in the # This source code is licensed under the CC-by-NC license found in the
# LICENSE file in the root directory of this source tree. # LICENSE file in the root directory of this source tree.
#!/usr/bin/env python2
# sorry for putting this in the main Faiss directory. This is to avoid # sorry for putting this in the main Faiss directory. This is to avoid
# having to write from python import faiss # having to write from python import faiss
...@@ -13,6 +12,7 @@ ...@@ -13,6 +12,7 @@
import numpy as np import numpy as np
import types import types
import sys import sys
import inspect
import pdb import pdb
...@@ -23,8 +23,8 @@ try: ...@@ -23,8 +23,8 @@ try:
except ImportError as e: except ImportError as e:
if e.args[0] != 'ImportError: No module named swigfaiss_gpu': if e.args[0] != 'ImportError: No module named swigfaiss_gpu':
# swigfaiss_gpu is there but failed to load: Warn user about it. # swigfaiss_gpu is there but failed to load: Warn user about it.
print >> sys.stderr, "Failed to load GPU Faiss: %s" % e.args[0] sys.stderr.write("Failed to load GPU Faiss: %s\n" % e.args[0])
print >> sys.stderr, "Faiss falling back to CPU-only." sys.stderr.write("Faiss falling back to CPU-only.\n")
from swigfaiss import * from swigfaiss import *
...@@ -170,7 +170,7 @@ this_module = sys.modules[__name__] ...@@ -170,7 +170,7 @@ this_module = sys.modules[__name__]
for symbol in dir(this_module): for symbol in dir(this_module):
obj = getattr(this_module, symbol) obj = getattr(this_module, symbol)
# print symbol, isinstance(obj, (type, types.ClassType)) # print symbol, isinstance(obj, (type, types.ClassType))
if isinstance(obj, (type, types.ClassType)): if inspect.isclass(obj):
the_class = obj the_class = obj
if issubclass(the_class, Index): if issubclass(the_class, Index):
handle_Index(the_class) handle_Index(the_class)
......
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