Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
faiss
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
faiss
Commits
2e15a969
Commit
2e15a969
authored
Mar 01, 2017
by
matthijs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
port to python 3
parent
86043e78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
Doxyfile
docs/Doxyfile
+1
-1
faiss.py
faiss.py
+4
-4
No files found.
docs/Doxyfile
View file @
2e15a969
...
@@ -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
...
...
faiss.py
View file @
2e15a969
...
@@ -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
i
sinstance
(
obj
,
(
type
,
types
.
ClassType
)
):
if
i
nspect
.
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment