MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / read_ivecs

Function read_ivecs

python/utils/io.py:5–10  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

3import numpy as np
4
5
6def read_ivecs(filename):
7 print(f"Reading File - {filename}")
8 a = np.fromfile(filename, dtype="int32")
9 d = a[0]
10 print(f"\t{filename} readed")
11 return a.reshape(-1, d + 1)[:, 1:]
12
13

Callers 1

read_fvecsFunction · 0.70

Calls 1

printFunction · 0.50

Tested by

no test coverage detected