Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python_bindings/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,9 @@ PYBIND11_PLUGIN(hnswlib) {
.def_property_readonly("M", [](const Index<float> & index) {
return index.index_inited ? index.appr_alg->M_ : 0;
})

.def_property_readonly("seed", [](const Index<float> & index) {
return index.seed;
})
.def(py::pickle(
[](const Index<float> &ind) { // __getstate__
return py::make_tuple(ind.getIndexParams()); /* Return dict (wrapped in a tuple) that fully encodes state of the Index object */
Expand Down