Skip to main content

serialize_state_dict_to_bytes

Function serialize_state_dict_to_bytes 

Source
pub fn serialize_state_dict_to_bytes(
    state_dict: &HashMap<String, Tensor>,
) -> Result<Vec<u8>, Error>
Expand description

Serialize a state dict (HashMap<String, Tensor>) to safetensors bytes.

This replaces direct Tensor::save_multi() calls, allowing writes through FsOps.