Skip to content

Commit ee87b7e

Browse files
added changes
1 parent 1775615 commit ee87b7e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

posting/index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,6 @@ func (vc *vectorCentroids) updateCentroids() {
14131413
func (vc *vectorCentroids) randomInit() {
14141414
vc.dimension = len(vc.centroids[0])
14151415
vc.numCenters = len(vc.centroids)
1416-
vc.centroids = make([][]float32, vc.numCenters)
14171416
vc.counts = make([]int64, vc.numCenters)
14181417
vc.weights = make([][]float32, vc.numCenters)
14191418
vc.mutexs = make([]*sync.Mutex, vc.numCenters)
@@ -1433,6 +1432,7 @@ const numCentroids = 1000
14331432
func rebuildVectorIndex(ctx context.Context, factorySpecs []*tok.FactoryCreateSpec, rb *IndexRebuild) error {
14341433
pk := x.ParsedKey{Attr: rb.Attr}
14351434
vc := &vectorCentroids{}
1435+
vc.centroids = make([][]float32, 0)
14361436

14371437
MemLayerInstance.IterateDisk(ctx, IterateDiskArgs{
14381438
Prefix: pk.DataPrefix(),

0 commit comments

Comments
 (0)