mlx.core.savez#
- savez(file: file | str | Path, *args, **kwargs)#
Save several arrays to a binary file in uncompressed
.npz
format.import mlx.core as mx x = mx.ones((10, 10)) mx.savez("my_path.npz", x=x) import mlx.nn as nn from mlx.utils import tree_flatten model = nn.TransformerEncoder(6, 128, 4) flat_params = tree_flatten(model.parameters()) mx.savez("model.npz", **dict(flat_params))