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

Set Python __slots__ on SWIG generated Python classes to avoid silent failures #3766

Open
asadoughi opened this issue Aug 16, 2024 · 1 comment

Comments

@asadoughi
Copy link
Contributor

Summary

Use Python slots to specify public member variables on C++ classes to avoid silent failures.

Reproduction instructions

index = faiss.index_factory(256, “OPQ64,IVF16384,PQ64”)
index.nprobe = 16

In this example, the silent failure misleads a user to believe they have set the nprobe parameter on the IVFPQ index. However, they have set a new Python object attribute nprobe on IndexPretransform which has no effect on the index search.

@mdouze
Copy link
Contributor

mdouze commented Aug 28, 2024

This seems to be a "new-object" specific feature. Would it work with our "old-object" model?

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

2 participants