1234567891011 |
- import numpy as np
- d = 64 # 向量维度
- nb = 100000 # index向量库的数据量
- nq = 10000 # 待检索query的数目
- np.random.seed(1234)
- xb = np.random.random((nb, d)).astype('float32')
- #xb[:, 0] += np.arange(nb) / 1000. # index向量库的向量
- xq = np.random.random((nq, d)).astype('float32')
- #xq[:, 0] += np.arange(nq) / 1000.
- print(xb)
|