faiss icon indicating copy to clipboard operation
faiss copied to clipboard

Conversion of np int64 and float64 to SWIG int and float

Open mdouze opened this issue 1 year ago • 2 comments

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

mdouze avatar Sep 17 '24 09:09 mdouze

Related to #3628?

asadoughi avatar Sep 17 '24 14:09 asadoughi

No it's a different issue.

mdouze avatar Nov 04 '24 10:11 mdouze