constraints.build_residual_fn

constraints.build_residual_fn(constraints, params)

Build a flat residual function over all constraints.

Each constraint’s residuals are scaled by its weight attribute before concatenation. Set constraint.weight at construction time to normalize across types or scales.