Skip to content

Commit

Permalink
3526: numpy 2 hacks
Browse files Browse the repository at this point in the history
* need to fix SWIG to understand why its not auto-converting np.float32 as float * as it was before
* numpy/numpy/18058 mentions we should be using show_config() or perhaps show_runtime() instead of the internal api
  • Loading branch information
asadoughi committed Aug 23, 2024
1 parent 5c87f13 commit 6d0da99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion faiss/python/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def is_sve_supported():
import numpy
if Version(numpy.__version__) >= Version("1.19"):
# use private API as next-best thing until numpy/numpy#18058 is solved
from numpy.core._multiarray_umath import __cpu_features__
from numpy._core._multiarray_umath import __cpu_features__
# __cpu_features__ is a dictionary with CPU features
# as keys, and True / False as values
supported = {k for k, v in __cpu_features__.items() if v}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def test_float(self):
D, I = ivf_tools.search_preassigned(index, xq, 4, a)
radius = D.max() * 1.01

lims, DR, IR = ivf_tools.range_search_preassigned(index, xq, radius, a)
lims, DR, IR = ivf_tools.range_search_preassigned(index, xq, float(radius), a)

# with that radius the k-NN results are a subset of the range search
# results
Expand Down

0 comments on commit 6d0da99

Please sign in to comment.