Skip to main content

Module testing

Module testing 

Source
Expand description

Numerical conformance helpers for custom rules.

The helpers accept closures for perturbation, differencing, and pairings so that the core protocol does not need a matrix, tensor, normed-space, or device-array abstraction.

Functionsยง

assert_adjoint_identity
Checks the adjoint identity for arbitrary tangent and cotangent types.
assert_close
Asserts approximate equality using combined absolute and relative tolerances.
assert_scalar_adjoint_identity
Scalar convenience wrapper for assert_adjoint_identity.
central_difference
Estimates a scalar directional derivative with a central difference.
directional_central_difference
Estimates a directional derivative for an arbitrary output type.