Skip to main content

Module sanity

Module sanity 

Source
Expand description

Optional NaN/Inf guards gated by crate::DENY_NAN / crate::DENY_INF. Optional NaN/Inf guards for debugging numerical issues.

Both checks are gated by the compile-time flags crate::DENY_NAN / crate::DENY_INF (both false by default). When the flags are off the functions compile down to nothing — there is no runtime cost in release builds — so calls can be sprinkled liberally through the forward passes.

Functions§

sanity
Panics if t contains a NaN (when crate::DENY_NAN is set) or an Inf (when crate::DENY_INF is set). A no-op when both flags are false.
sanity_nan
Like sanity but checks only for NaN (ignores Inf).