ndarray-safetensors
Serialize / deserialize Rust ndarray with Safetensors.
Demo
See safetensors-testapp for more details. Here is an end-to-end demo to print all tensors from a safetensors file.
use parse_tensor_view_data;
let path_example = new;
let file = open.unwrap;
let buffer = unsafe ;
let tensors = deserialize.unwrap;
for in tensors.tensors
Features
unsafe_copy: Allowing directly copying the bytes instead of parsing floats in serialization/deserialization for little-endian machines.
Copyright & License
Copyright (c) 2024-2025 Mengxiao Lin. Check LICENSE file.