-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: cqy123456 <[email protected]> Add (b)float16 interface for pyknowhere Signed-off-by: Writer-X <[email protected]>
- Loading branch information
Showing
45 changed files
with
1,561 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
#include "knowhere/index_node.h" | ||
|
||
namespace knowhere { | ||
|
||
template <typename T1> | ||
class Index { | ||
public: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
// Copyright (C) 2019-2023 Zilliz. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software distributed under the License | ||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
// or implied. See the License for the specific language governing permissions and limitations under the License. | ||
|
||
#ifndef INDEX_NODE_DATA_MOCK_WRAPPER_H | ||
#define INDEX_NODE_DATA_MOCK_WRAPPER_H | ||
|
||
#include "knowhere/index_node.h" | ||
namespace knowhere { | ||
|
||
template <typename DataType> | ||
class IndexNodeDataMockWrapper : public IndexNode { | ||
public: | ||
IndexNodeDataMockWrapper(std::unique_ptr<IndexNode> index_node) : index_node_(std::move(index_node)) { | ||
} | ||
|
||
Status | ||
Build(const DataSet& dataset, const Config& cfg) override; | ||
|
||
Status | ||
Train(const DataSet& dataset, const Config& cfg) override; | ||
|
||
Status | ||
Add(const DataSet& dataset, const Config& cfg) override; | ||
expected<DataSetPtr> | ||
Search(const DataSet& dataset, const Config& cfg, const BitsetView& bitset) const override; | ||
|
||
expected<DataSetPtr> | ||
RangeSearch(const DataSet& dataset, const Config& cfg, const BitsetView& bitset) const override; | ||
|
||
expected<std::vector<std::shared_ptr<iterator>>> | ||
AnnIterator(const DataSet& dataset, const Config& cfg, const BitsetView& bitset) const override; | ||
|
||
expected<DataSetPtr> | ||
GetVectorByIds(const DataSet& dataset) const override; | ||
|
||
bool | ||
HasRawData(const std::string& metric_type) const override { | ||
return index_node_->HasRawData(metric_type); | ||
} | ||
|
||
expected<DataSetPtr> | ||
GetIndexMeta(const Config& cfg) const override { | ||
return index_node_->GetIndexMeta(cfg); | ||
} | ||
|
||
Status | ||
Serialize(BinarySet& binset) const override { | ||
return index_node_->Serialize(binset); | ||
} | ||
|
||
Status | ||
Deserialize(const BinarySet& binset, const Config& config) override { | ||
return index_node_->Deserialize(binset, config); | ||
} | ||
|
||
Status | ||
DeserializeFromFile(const std::string& filename, const Config& config) override { | ||
return index_node_->DeserializeFromFile(filename, config); | ||
} | ||
|
||
std::unique_ptr<BaseConfig> | ||
CreateConfig() const override { | ||
return index_node_->CreateConfig(); | ||
} | ||
|
||
int64_t | ||
Dim() const override { | ||
return index_node_->Dim(); | ||
} | ||
|
||
int64_t | ||
Size() const override { | ||
return index_node_->Size(); | ||
} | ||
|
||
int64_t | ||
Count() const override { | ||
return index_node_->Count(); | ||
} | ||
|
||
std::string | ||
Type() const override { | ||
return index_node_->Type(); | ||
} | ||
|
||
private: | ||
std::unique_ptr<IndexNode> index_node_; | ||
}; | ||
|
||
} // namespace knowhere | ||
|
||
#endif /* INDEX_NODE_DATA_MOCK_WRAPPER_H */ |
Oops, something went wrong.