//! Shared implementation of dynamic loss scale update.
//!
//! Pure scalar logic — identical for all backends. No tensors involved.
use crateResult;
/// Update dynamic loss scale based on inf/nan history.
///
/// If `found_inf`: scale down by `backoff_factor`, reset tracker.
/// Otherwise: increment tracker; if it reaches `growth_interval`, double the scale.