Skip to content

Commit

Permalink
fix: Use correct idx when Serialize Sparse vector
Browse files Browse the repository at this point in the history
See also #728

Signed-off-by: Congqi Xia <[email protected]>
  • Loading branch information
congqixia committed Apr 17, 2024
1 parent c1808a8 commit 15cdb41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entity/columns_sparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (e sliceSparseEmbedding) Serialize() []byte {
for idx := 0; idx < e.Len(); idx++ {
pos, value, _ := e.Get(idx)
binary.LittleEndian.PutUint32(row[idx*8:], pos)
binary.LittleEndian.PutUint32(row[pos*8+4:], math.Float32bits(value))
binary.LittleEndian.PutUint32(row[idx*8+4:], math.Float32bits(value))
}
return row
}
Expand Down

0 comments on commit 15cdb41

Please sign in to comment.