Skip to main content

eval_forward

Function eval_forward 

Source
pub fn eval_forward<T: Float>(op: OpCode, a: T, b: T) -> T
Available on crate feature bytecode only.
Expand description

Evaluate a single opcode in the forward direction.

Generic over T: Float so the tangent sweeps can evaluate it with Dual<F> and nested duals (forward-over-reverse).

For binary ops, a and b are the two operand values. For unary ops, a is the operand value and b is ignored (except OpCode::Powi where b bits encode the i32 exponent).