mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-28 14:35:27 +08:00
fix(wrapper): fix write index
Former-commit-id: 98af046872115568f3b4e7859bf6b6970b0655f6
This commit is contained in:
parent
8d163abd42
commit
92983fcfbf
@ -62,6 +62,10 @@ bool Index::search(idx_t n, const float *data, idx_t k, float *distances, long *
|
||||
return true;
|
||||
}
|
||||
|
||||
void write_index(const Index_ptr &index, const std::string &file_name) {
|
||||
write_index(index->index_.get(), file_name.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,6 +23,9 @@ namespace zilliz {
|
||||
namespace vecwise {
|
||||
namespace engine {
|
||||
|
||||
class Index;
|
||||
using Index_ptr = std::shared_ptr<Index>;
|
||||
|
||||
class Index {
|
||||
typedef long idx_t;
|
||||
|
||||
@ -61,6 +64,7 @@ public:
|
||||
// virtual bool index_display();
|
||||
|
||||
private:
|
||||
friend void write_index(const Index_ptr &index, const std::string &file_name);
|
||||
std::shared_ptr<faiss::Index> index_ = nullptr;
|
||||
// std::vector<faiss::gpu::GpuResources *> res_;
|
||||
// std::vector<int> devs_;
|
||||
@ -69,9 +73,8 @@ private:
|
||||
// faiss::gpu::GpuMultipleClonerOptions *options = new faiss::gpu::GpuMultipleClonerOptions();
|
||||
};
|
||||
|
||||
using Index_ptr = std::shared_ptr<Index>;
|
||||
|
||||
extern void write_index(const Index_ptr &index, const std::string &file_name);
|
||||
void write_index(const Index_ptr &index, const std::string &file_name);
|
||||
|
||||
extern Index_ptr read_index(const std::string &file_name);
|
||||
|
||||
@ -79,4 +82,3 @@ extern Index_ptr read_index(const std::string &file_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user