faiss 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/faiss/extconf.rb +1 -1
- data/ext/faiss/index.cpp +10 -14
- data/ext/faiss/numo.hpp +957 -833
- data/lib/faiss/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc3446fb52271b6e55c4e0ba64cf7146d8bcff39316803e9e7fac68caa0b1d7d
|
4
|
+
data.tar.gz: fb3bdc9c66b670413df99c0f1d914fd4861ccce30e11a1f959fb570d62d7dca0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b56a61bbe96f7aa628b0eb819b9404c6c48fba6f2c6cf3802d32fad52a8cbb1abbf97e09700c5d2b22faafef7ba2c5424839f7e98dacbb32d86a60c565c1b9f1
|
7
|
+
data.tar.gz: dce96c87b15ee7708e1c08f5f7ab4d04c1fb2f4399d5d423cb1ab9de7099ffc0a1bb81a968fb527562bd3d42d1cd131e60fc80cff668de6fa8270c7a81dec8a5
|
data/CHANGELOG.md
CHANGED
data/ext/faiss/extconf.rb
CHANGED
@@ -20,7 +20,7 @@ abort "Numo not found" unless find_header("numo/narray.h", numo)
|
|
20
20
|
$LDFLAGS += " -Wl,-undefined,dynamic_lookup" if RbConfig::CONFIG["host_os"] =~ /darwin/i
|
21
21
|
|
22
22
|
$CXXFLAGS += " -std=c++17 $(optflags) -DFINTEGER=int"
|
23
|
-
$CXXFLAGS += " -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wno-deprecated-declarations -Wno-sign-compare"
|
23
|
+
$CXXFLAGS += " -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wno-unused-private-field -Wno-deprecated-declarations -Wno-sign-compare"
|
24
24
|
|
25
25
|
# -march=native not supported with ARM Mac
|
26
26
|
default_optflags = RbConfig::CONFIG["host_os"] =~ /darwin/i && RbConfig::CONFIG["host_cpu"] =~ /arm|aarch64/i ? "" : " -march=native"
|
data/ext/faiss/index.cpp
CHANGED
@@ -17,10 +17,7 @@ namespace Rice::detail {
|
|
17
17
|
template<>
|
18
18
|
struct Type<faiss::MetricType>
|
19
19
|
{
|
20
|
-
static bool verify()
|
21
|
-
{
|
22
|
-
return true;
|
23
|
-
}
|
20
|
+
static bool verify() { return true; }
|
24
21
|
};
|
25
22
|
|
26
23
|
template<>
|
@@ -29,9 +26,9 @@ namespace Rice::detail {
|
|
29
26
|
public:
|
30
27
|
From_Ruby() = default;
|
31
28
|
|
32
|
-
From_Ruby(Arg* arg) : arg_(arg)
|
33
|
-
|
34
|
-
}
|
29
|
+
From_Ruby(Arg* arg) : arg_(arg) {}
|
30
|
+
|
31
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
35
32
|
|
36
33
|
faiss::MetricType convert(VALUE x)
|
37
34
|
{
|
@@ -56,16 +53,15 @@ namespace Rice::detail {
|
|
56
53
|
template<>
|
57
54
|
struct Type<faiss::ScalarQuantizer::QuantizerType>
|
58
55
|
{
|
59
|
-
static bool verify()
|
60
|
-
{
|
61
|
-
return true;
|
62
|
-
}
|
56
|
+
static bool verify() { return true; }
|
63
57
|
};
|
64
58
|
|
65
59
|
template<>
|
66
60
|
class From_Ruby<faiss::ScalarQuantizer::QuantizerType>
|
67
61
|
{
|
68
62
|
public:
|
63
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
64
|
+
|
69
65
|
faiss::ScalarQuantizer::QuantizerType convert(VALUE x)
|
70
66
|
{
|
71
67
|
auto s = Object(x).to_s().str();
|
@@ -166,10 +162,10 @@ void init_index(Rice::Module& m) {
|
|
166
162
|
.define_constructor(Rice::Constructor<faiss::IndexFlatIP, int64_t>());
|
167
163
|
|
168
164
|
Rice::define_class_under<faiss::IndexHNSWFlat, faiss::Index>(m, "IndexHNSWFlat")
|
169
|
-
.define_constructor(Rice::Constructor<faiss::IndexHNSWFlat, int, int, faiss::MetricType>(), Rice::Arg("
|
165
|
+
.define_constructor(Rice::Constructor<faiss::IndexHNSWFlat, int, int, faiss::MetricType>(), Rice::Arg("_d"), Rice::Arg("_M"), Rice::Arg("_metric") = faiss::METRIC_L2);
|
170
166
|
|
171
167
|
Rice::define_class_under<faiss::IndexIVFFlat, faiss::Index>(m, "IndexIVFFlat")
|
172
|
-
.define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t, faiss::MetricType>(), Rice::Arg("
|
168
|
+
.define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t, faiss::MetricType>(), Rice::Arg("_quantizer"), Rice::Arg("_d"), Rice::Arg("_nlist"), Rice::Arg("_metric") = faiss::METRIC_L2);
|
173
169
|
|
174
170
|
Rice::define_class_under<faiss::IndexLSH, faiss::Index>(m, "IndexLSH")
|
175
171
|
.define_constructor(Rice::Constructor<faiss::IndexLSH, int64_t, int>());
|
@@ -184,7 +180,7 @@ void init_index(Rice::Module& m) {
|
|
184
180
|
.define_constructor(Rice::Constructor<faiss::IndexIVFScalarQuantizer, faiss::Index*, size_t, size_t, faiss::ScalarQuantizer::QuantizerType>());
|
185
181
|
|
186
182
|
Rice::define_class_under<faiss::IndexIVFPQ, faiss::Index>(m, "IndexIVFPQ")
|
187
|
-
.define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t, faiss::MetricType>(), Rice::Arg("
|
183
|
+
.define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t, faiss::MetricType>(), Rice::Arg("_quantizer"), Rice::Arg("_d"), Rice::Arg("_nlist"), Rice::Arg("_M"), Rice::Arg("_nbits_per_idx"), Rice::Arg("_metric") = faiss::METRIC_L2);
|
188
184
|
|
189
185
|
Rice::define_class_under<faiss::IndexIVFPQR, faiss::Index>(m, "IndexIVFPQR")
|
190
186
|
.define_constructor(Rice::Constructor<faiss::IndexIVFPQR, faiss::Index*, size_t, size_t, size_t, size_t, size_t, size_t>());
|