Docs / nablatensor-engine-cpu / com.nablatensor.engine.jit
interface
JitKernel
The interface the generated tape-specific class implements. One instance is built per tape; a replay is two virtual calls, each dispatching into straight-line generated bytecode.
Methods
double forward(double[] v, double[] in, double[] draws, double[] scratch)
Forward sweep for one scenario: fills v (one slot per tape node), reading differentiable inputs from in and this path's pre-generated normal draws from draws, and returns v[output]. scratch is the rolled kernel's step-tape (ignored by the flat kernel; may be empty).
void reverse(double[] v, double[] d, double[] scratch, double[] draws)
Reverse sweep: d arrives zeroed except d[output] == 1.0; on return it holds the adjoint of every node, so d[inputNode[j]] is the gradient w.r.t. input j. scratch carries the forward step-tape for the rolled kernel.