rustensor 0.1.0

Small Rust-native checkpoint format for model metadata and tensor weights.
Documentation
//! rustensor
//!
//! Small Rust-native checkpoint format for storing model metadata and tensor
//! weights in a single verifiable `.rten` file.
//!
//! This crate does not train models, does not run inference and does not aim
//! to replace ONNX, GGUF or SafeTensors.

pub mod checkpoint;
pub mod error;
pub mod format;
pub mod integrity;
pub mod metadata;
pub mod reader;
pub mod weights;
pub mod writer;

pub use crate::checkpoint::{MAX_LAYER_COUNT, ModelCheckpoint};
pub use crate::error::{Result, RustensorError};
pub use crate::format::{
    CHECKSUM_SIZE, FORMAT_VERSION, HEADER_SIZE, MAGIC_BYTES, MAX_PAYLOAD_SIZE, RtenHeader,
};
pub use crate::metadata::ModelMetadata;
pub use crate::reader::load_checkpoint;
pub use crate::weights::{MAX_DIMENSIONS, TensorDType, TensorData, WeightLayer};
pub use crate::writer::save_checkpoint;

pub const CRATE_NAME: &str = "rustensor";

pub fn crate_name() -> &'static str {
    CRATE_NAME
}

pub use crate::integrity::{sha256_hex, sha256_payload, verify_checksum};

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn crate_name_is_rustensor() {
        assert_eq!(crate_name(), "rustensor");
    }
}