Fix the npy read function and add some testing. (#1080)

This commit is contained in:
Laurent Mazare
2023-10-12 15:25:05 +02:00
committed by GitHub
parent c096f02411
commit 7473c4ceca
5 changed files with 33 additions and 2 deletions

9
candle-core/tests/npy.py Normal file
View File

@ -0,0 +1,9 @@
import numpy as np
x = np.arange(10)
# Write a npy file.
np.save("test.npy", x)
# Write multiple values to a npz file.
values = { "x": x, "x_plus_one": x + 1 }
np.savez("test.npz", **values)