pub struct Net32 {
pub sizes: Vec<usize>,
pub w: Vec<Vec<i32>>,
pub b: Vec<Vec<i32>>,
}Expand description
A network prepared for 32-bit inference.
Fields§
§sizes: Vec<usize>Layer sizes (input = NFL).
w: Vec<Vec<i32>>Clamped Q8 weights per layer (out × in).
b: Vec<Vec<i32>>Clamped Q16 biases.
Implementations§
Source§impl Net32
impl Net32
Sourcepub fn graph(&self) -> (IntGraph, Vec<IId>)
pub fn graph(&self) -> (IntGraph, Vec<IId>)
The forward pass as a tang-expr integer graph: params are the
NFL clamped inputs, outputs the NO mixture parameters. Zero
weights are dropped (integer addition is associative, so no bit
changes). This one graph is lowered to the GPU kernel’s MLP and
evaluated as the CPU reference (Net32::program).
Sourcepub fn program(&self) -> Program
pub fn program(&self) -> Program
Net32::graph compiled for Net32::infer_ir.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Net32
impl RefUnwindSafe for Net32
impl Send for Net32
impl Sync for Net32
impl Unpin for Net32
impl UnsafeUnpin for Net32
impl UnwindSafe for Net32
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more