faiss 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/faiss/ext.cpp +2 -3
- data/ext/faiss/index.cpp +13 -14
- data/ext/faiss/index_binary.cpp +2 -0
- data/ext/faiss/kmeans.cpp +2 -0
- data/ext/faiss/pca_matrix.cpp +2 -0
- data/ext/faiss/product_quantizer.cpp +2 -0
- data/ext/faiss/utils.cpp +3 -0
- data/lib/faiss/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94cc2ecdeb397dfce274b08f07006ec7d6d13290f4149d8fca0b9d1a3f2312c6
|
4
|
+
data.tar.gz: a32b28f7bc57f9bad918b0411855617951ce8013af7f1ca9dfc72978f5eb1f78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 317786c14bbd6803a8abd506881e7072dbd8bfaacce3968c8c26705de45f1840177f5fb3ce189b464e5f1bbffd07a277d6f454a977e1e2aef72bdfb7d7cd04a7
|
7
|
+
data.tar.gz: 4de11b05b094b18beaa0326e5d4bf2d7a71c1928b7bd7d12f28f430f7b40b023c6c7b7a4da73f74bc39b0be44c85677113597cf6b60ae4029a96bd11a41f706c
|
data/CHANGELOG.md
CHANGED
data/ext/faiss/ext.cpp
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#include
|
1
|
+
#include <rice/rice.hpp>
|
2
2
|
|
3
3
|
void init_index(Rice::Module& m);
|
4
4
|
void init_index_binary(Rice::Module& m);
|
@@ -7,8 +7,7 @@ void init_pca_matrix(Rice::Module& m);
|
|
7
7
|
void init_product_quantizer(Rice::Module& m);
|
8
8
|
|
9
9
|
extern "C"
|
10
|
-
void Init_ext()
|
11
|
-
{
|
10
|
+
void Init_ext() {
|
12
11
|
auto m = Rice::define_module("Faiss");
|
13
12
|
|
14
13
|
init_index(m);
|
data/ext/faiss/index.cpp
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
#include <string>
|
2
|
+
|
3
|
+
#include <faiss/AutoTune.h>
|
1
4
|
#include <faiss/Index.h>
|
2
5
|
#include <faiss/IndexFlat.h>
|
3
6
|
#include <faiss/IndexHNSW.h>
|
@@ -9,20 +12,20 @@
|
|
9
12
|
#include <faiss/IndexIVFPQ.h>
|
10
13
|
#include <faiss/IndexIVFPQR.h>
|
11
14
|
#include <faiss/index_io.h>
|
12
|
-
#include <
|
15
|
+
#include <rice/rice.hpp>
|
16
|
+
#include <rice/stl.hpp>
|
13
17
|
|
18
|
+
#include "numo.hpp"
|
14
19
|
#include "utils.h"
|
15
20
|
|
16
21
|
namespace Rice::detail {
|
17
22
|
template<>
|
18
|
-
struct Type<faiss::MetricType>
|
19
|
-
{
|
23
|
+
struct Type<faiss::MetricType> {
|
20
24
|
static bool verify() { return true; }
|
21
25
|
};
|
22
26
|
|
23
27
|
template<>
|
24
|
-
class From_Ruby<faiss::MetricType>
|
25
|
-
{
|
28
|
+
class From_Ruby<faiss::MetricType> {
|
26
29
|
public:
|
27
30
|
From_Ruby() = default;
|
28
31
|
|
@@ -30,8 +33,7 @@ namespace Rice::detail {
|
|
30
33
|
|
31
34
|
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
32
35
|
|
33
|
-
faiss::MetricType convert(VALUE x)
|
34
|
-
{
|
36
|
+
faiss::MetricType convert(VALUE x) {
|
35
37
|
if (x == Qnil && this->arg_ && this->arg_->hasDefaultValue()) {
|
36
38
|
return this->arg_->defaultValue<faiss::MetricType>();
|
37
39
|
}
|
@@ -51,19 +53,16 @@ namespace Rice::detail {
|
|
51
53
|
};
|
52
54
|
|
53
55
|
template<>
|
54
|
-
struct Type<faiss::ScalarQuantizer::QuantizerType>
|
55
|
-
{
|
56
|
+
struct Type<faiss::ScalarQuantizer::QuantizerType> {
|
56
57
|
static bool verify() { return true; }
|
57
58
|
};
|
58
59
|
|
59
60
|
template<>
|
60
|
-
class From_Ruby<faiss::ScalarQuantizer::QuantizerType>
|
61
|
-
{
|
61
|
+
class From_Ruby<faiss::ScalarQuantizer::QuantizerType> {
|
62
62
|
public:
|
63
63
|
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
64
64
|
|
65
|
-
faiss::ScalarQuantizer::QuantizerType convert(VALUE x)
|
66
|
-
{
|
65
|
+
faiss::ScalarQuantizer::QuantizerType convert(VALUE x) {
|
67
66
|
auto s = Object(x).to_s().str();
|
68
67
|
if (s == "qt_8bit") {
|
69
68
|
return faiss::ScalarQuantizer::QT_8bit;
|
@@ -84,7 +83,7 @@ namespace Rice::detail {
|
|
84
83
|
}
|
85
84
|
}
|
86
85
|
};
|
87
|
-
}
|
86
|
+
} // namespace Rice::detail
|
88
87
|
|
89
88
|
void init_index(Rice::Module& m) {
|
90
89
|
Rice::define_class_under<faiss::Index>(m, "Index")
|
data/ext/faiss/index_binary.cpp
CHANGED
data/ext/faiss/kmeans.cpp
CHANGED
data/ext/faiss/pca_matrix.cpp
CHANGED
data/ext/faiss/utils.cpp
CHANGED
data/lib/faiss/version.rb
CHANGED