mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-10 07:49:29 +08:00
f8d9bc919d
Signed-off-by: dragondriver <jiquan.long@zilliz.com>
30 lines
486 B
Go
30 lines
486 B
Go
package indexnode
|
|
|
|
import "math/rand"
|
|
|
|
const (
|
|
dim = 8
|
|
nb = 10000
|
|
nprobe = 8
|
|
)
|
|
|
|
func generateFloatVectors() []float32 {
|
|
vectors := make([]float32, 0)
|
|
for i := 0; i < nb; i++ {
|
|
for j := 0; j < dim; j++ {
|
|
vectors = append(vectors, rand.Float32())
|
|
}
|
|
}
|
|
return vectors
|
|
}
|
|
|
|
func generateBinaryVectors() []byte {
|
|
vectors := make([]byte, 0)
|
|
for i := 0; i < nb; i++ {
|
|
for j := 0; j < dim/8; j++ {
|
|
vectors = append(vectors, byte(rand.Intn(8)))
|
|
}
|
|
}
|
|
return vectors
|
|
}
|