We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 006d7b2 + 5aba6c6 commit f6d170cCopy full SHA for f6d170c
hnswlib/hnswalg.h
@@ -102,7 +102,13 @@ class HierarchicalNSW : public AlgorithmInterface<dist_t> {
102
data_size_ = s->get_data_size();
103
fstdistfunc_ = s->get_dist_func();
104
dist_func_param_ = s->get_dist_func_param();
105
- M_ = M;
+ if ( M <= 10000 ) {
106
+ M_ = M;
107
+ } else {
108
+ std::cerr << "warning: M parameter exceeds 10000 which may lead to adverse effects." << std::endl;
109
+ std::cerr << " Cap to 10000 will be applied for the rest of the processing." << std::endl;
110
+ M_ = 10000;
111
+ }
112
maxM_ = M_;
113
maxM0_ = M_ * 2;
114
ef_construction_ = std::max(ef_construction, M_);
0 commit comments