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.
Summary
Use Python slots to specify public member variables on C++ classes to avoid silent failures.
Reproduction instructions
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.