Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion of np int64 and float64 to SWIG int and float #3866

Open
mdouze opened this issue Sep 17, 2024 · 2 comments
Open

Conversion of np int64 and float64 to SWIG int and float #3866

mdouze opened this issue Sep 17, 2024 · 2 comments

Comments

@mdouze
Copy link
Contributor

mdouze commented Sep 17, 2024

Faiss does not transparently convert numpy int64 and float64 / float32 to SWIG's int and float

import faiss
import numpy as np

a = np.array([4, 6])

d = a[0]
faiss.IndexFlatL2(d) # fails 
faiss.IndexFlatL2(int(d)) # works

It should be possible to fix it with SWIG typemaps

@asadoughi
Copy link
Contributor

Related to #3628?

@asadoughi asadoughi assigned mnorris11 and unassigned mnorris11 Oct 2, 2024
@mdouze
Copy link
Contributor Author

mdouze commented Nov 4, 2024

No it's a different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants