GradCheckResult
Interface in IR
What gradCheck returns.
import type { GradCheckResult } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
interface GradCheckResult { readonly ok: boolean; readonly checked: number; readonly worst?: { /** The parameter. */ readonly param: string; /** The index of the point in {@link GradCheckOptions.at}. */ readonly point: number; /** The component of the parameter, `0` for a scalar. */ readonly component: number; /** The component of the result, `0` for a scalar. */ readonly output: number; /** The partial derivative the derivative function gives. */ readonly derivative: number; /** The central difference. */ readonly difference: number; };}Instance properties
okread onlybooleantruewhen every partial derivative is within the tolerance.checkedread onlynumberThe count of partial derivatives compared.
worstoptionalread only{ /** The parameter. */ readonly param: string; /** The index of the point in {@link GradCheckOptions.at}. */ readonly point: number; /** The component of the parameter, `0` for a scalar. */ readonly component: number; /** The component of the result, `0` for a scalar. */ readonly output: number; /** The partial derivative the derivative function gives. */ readonly derivative: number; /** The central difference. */ readonly difference: number; }The partial derivative farthest outside the tolerance, relative to it, and where the derivative and the central difference part. Absent when
ok.
See also
Source
src/core/passes/grad-check.ts, line 36, at commit af54ddad5