style: apply rustfmt across all crates and demos
Consistent formatting pass: line wrapping, import sorting, trailing whitespace removal, let-chain indentation, merged derive attributes, and unsafe block reformatting. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
@@ -163,10 +163,7 @@ impl GradientClipper {
|
||||
/// Compute infinity norm of gradients.
|
||||
#[must_use]
|
||||
pub fn linf_norm(&self, gradients: &[f32]) -> f32 {
|
||||
gradients
|
||||
.iter()
|
||||
.map(|g| g.abs())
|
||||
.fold(0.0_f32, f32::max)
|
||||
gradients.iter().map(|g| g.abs()).fold(0.0_f32, f32::max)
|
||||
}
|
||||
|
||||
/// Get the clip norm.
|
||||
|
||||
Reference in New Issue
Block a user