MLX-CL/IO/NPY
Support NPY file read and write
Table of Contents
1. About
MLX-CL/IO/NPY add support for reading and writing mlx-array from and to NPY file
via marcoheisig/numpy-file-format.
2. Usage
2.1. Loading
(ql:quickload :mlx-cl/io/npy)
2.2. Reading NPY file
(mlx-array "./res/dat/example.npy")
array([[1, 2, 3],
[4, 5, 6]], dtype=float32)
this is equal to calling:
(load-from "./res/dat/example.npy" :npy)
2.3. Writing NPY file
(save (mlx-array #2A((1 2 3) (4 5 6))) :output "./res/tmp/example.npy")
./res/tmp/example.npy
import numpy as np
print(np.load("./res/tmp/example.npy"))
[[1 2 3] [4 5 6]]