fix: ivf optimize (#169)

This commit is contained in:
ZeFeng Yin
2026-02-27 17:35:52 +08:00
committed by GitHub
parent 0d84e30dd3
commit ba6acbf48f
3 changed files with 99 additions and 7 deletions
+3 -3
View File
@@ -64,8 +64,8 @@ class CosineConverterHolder : public IndexHolder {
//! Retrieve pointer of data
const void *data(void) const override {
return type_ == IndexMeta::DataType::DT_FP32 ? normalize_buffer_.data()
: buffer_.data();
return type_ == original_type_ ? normalize_buffer_.data()
: buffer_.data();
}
//! Test if the iterator is valid
@@ -325,7 +325,7 @@ class CosineConverter : public IndexConverter {
//! Transform the data
int transform(IndexHolder::Pointer holder) override {
if (holder->data_type() != IndexMeta::DataType::DT_FP32 ||
if (holder->data_type() != original_type_ ||
holder->dimension() != meta_.dimension() - ExtraDimension(dst_type_)) {
return IndexError_Mismatch;
}