native_neural_network 0.1.6

Lib no_std Rust for native neural network (.rnn)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::layers::LayerPlan;

pub fn required_single_infer_scratch(plan: &LayerPlan<'_>) -> Option<usize> {
    plan.max_width()?.checked_mul(2)
}

pub fn validate_forward_io(plan: &LayerPlan<'_>, input_len: usize, output_len: usize) -> bool {
    match (plan.input_size(), plan.output_size()) {
        (Some(i), Some(o)) => i == input_len && o == output_len,
        _ => false,
    }
}