Skip to main content

generic_row_kernel

Function generic_row_kernel 

Source
pub fn generic_row_kernel<const K: usize, P: RowNllProgramGeneric<K> + ?Sized>(
    prog: &P,
    row: usize,
) -> Result<(f64, [f64; K], [[f64; K]; K]), String>
Expand description

Evaluate a generic program at the value/gradient/Hessian scalar crate::jet_scalar::Order2, returning (nll, ∇, H) — the row_kernel channel — WITHOUT materialising any third / fourth tensor.

This is the production seam for the inner-Newton (v, g, H) path: the row loss is written ONCE in row_nll_generic, and this routes it through the cheap order-2 scalar. The single source of truth means the gradient and Hessian cannot desync from the value (the #736 / #948 bug genus).