resolve_loss_reduction¶
- resolve_loss_reduction(reduction)[source]¶
Resolve a
LossReductionFnliteral/callable to a concrete callable.User-supplied callables are wrapped in
float(...)so naked numpy reductions (e.g.loss_reduction=np.mean) — which return a 0-dndarray— produce a plain Python float, matching the contract that downstream stages andlosses_historyexpect.