native_neural_network 0.3.1

Lib no_std Rust for native neural network (.rnn)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::types::Precision;
use core::sync::atomic::{AtomicU8, Ordering};

static PRECISION: AtomicU8 = AtomicU8::new(Precision::F32 as u8);

pub fn set_precision(p: Precision) {
    PRECISION.store(p as u8, Ordering::SeqCst);
}

pub fn get_precision() -> Precision {
    match PRECISION.load(Ordering::SeqCst) {
        1 => Precision::F64,
        _ => Precision::F32,
    }
}