mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 08:46:49 +02:00
Initial commit
This commit is contained in:
commit
4c8ad629e0
28 changed files with 6758 additions and 0 deletions
22
tests/utils.py
Normal file
22
tests/utils.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import numpy as np
|
||||
from io import BytesIO
|
||||
|
||||
|
||||
def to_npy(arr):
|
||||
buf = BytesIO()
|
||||
np.save(buf, arr)
|
||||
buf.seek(0)
|
||||
return buf.read()
|
||||
|
||||
|
||||
to_npy(np.array([[1.0, 2.0, 3.0], [2.0, 3.0, 4.0]], dtype=np.float32))
|
||||
|
||||
print(to_npy(np.array([[1.0, 2.0]], dtype=np.float32)))
|
||||
print(to_npy(np.array([1.0, 2.0], dtype=np.float32)))
|
||||
|
||||
to_npy(
|
||||
np.array(
|
||||
[np.zeros(10), np.zeros(10), np.zeros(10), np.zeros(10), np.zeros(10)],
|
||||
dtype=np.float32,
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue