native_neural_network_std 0.2.1

Ergonomic std wrapper for the `native_neural_network` crate (no_std) — std-friendly re-exports and utilities.
Documentation
#[derive(Debug)]
pub enum LoraStdError {
    ShapeMismatch,
}

impl From<native_neural_network::lora::LoraError> for LoraStdError {
    fn from(e: native_neural_network::lora::LoraError) -> Self {
        match e {
            native_neural_network::lora::LoraError::ShapeMismatch => LoraStdError::ShapeMismatch,
        }
    }
}

pub fn apply_lora_delta(
    base_weight: &mut [f32],
    rows: usize,
    cols: usize,
    a: &[f32],
    b: &[f32],
    rank: usize,
    alpha: f32,
) -> Result<(), LoraStdError> {
    native_neural_network::lora::apply_lora_delta(base_weight, rows, cols, a, b, rank, alpha)
        .map_err(|e| e.into())
}

impl core::fmt::Display for LoraStdError {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "LoraStdError::{:?}", self)
    }
}
impl std::error::Error for LoraStdError {}