MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / register_symqg

Function register_symqg

python_bindings/symqg_bindings.cpp:115–139  ·  view source on GitHub ↗

Register Symqg bindings into combined module

Source from the content-addressed store, hash-verified

113 dists_data + (idx * k)
114 );
115 } catch (...) {
116#pragma omp critical(rabitq_symqg_search_error)
117 {
118 if (!error) {
119 error = std::current_exception();
120 }
121 }
122 failed.store(true, std::memory_order_relaxed);
123 }
124 }
125 if (error) {
126 std::rethrow_exception(error);
127 }
128
129 return py::make_tuple(ids, dists);
130 }
131
132 void save(const std::string& path) const {
133 if (!built_) {
134 throw std::runtime_error("SymqgIndex must be built before save");
135 }
136 index_->save(path.c_str());
137 }
138
139 static SymqgIndex load(const std::string& path) {
140 SymqgIndex wrapper;
141 wrapper.index_ = std::make_unique<rabitqlib::symqg::QuantizedGraph<float>>();
142 wrapper.index_->load(path.c_str());

Callers 1

PYBIND11_MODULEFunction · 0.85

Calls 1

argFunction · 0.50

Tested by

no test coverage detected