Skip to content

Commit

Permalink
Fixed ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Mar 13, 2024
1 parent 70d2f9c commit 3a87d61
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ext/faiss/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void init_index(Rice::Module& m) {
"load",
[](Rice::String fname) {
return faiss::read_index(fname.c_str());
});
}, Rice::Return().takeOwnership());

Rice::define_class_under<faiss::IndexFlatL2, faiss::Index>(m, "IndexFlatL2")
.define_constructor(Rice::Constructor<faiss::IndexFlatL2, int64_t>());
Expand Down
4 changes: 2 additions & 2 deletions ext/faiss/index_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void init_index_binary(Rice::Module& m) {
"load",
[](Rice::String fname) {
return faiss::read_index_binary(fname.c_str());
});
}, Rice::Return().takeOwnership());

Rice::define_class_under<faiss::IndexBinaryFlat, faiss::IndexBinary>(m, "IndexBinaryFlat")
.define_constructor(Rice::Constructor<faiss::IndexBinaryFlat, int64_t>());
Expand All @@ -71,5 +71,5 @@ void init_index_binary(Rice::Module& m) {
"index_binary_factory",
[](int d, Rice::String description) {
return faiss::index_binary_factory(d, description.c_str());
});
}, Rice::Return().takeOwnership());
}
2 changes: 1 addition & 1 deletion ext/faiss/product_quantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ void init_product_quantizer(Rice::Module& m) {
"load",
[](Rice::String fname) {
return faiss::read_ProductQuantizer(fname.c_str());
});
}, Rice::Return().takeOwnership());
}

0 comments on commit 3a87d61

Please sign in to comment.