style: cargo fmt --workspace (whitespace/wrapping only, no semantic change)

Whole-workspace rustfmt pass picked up while iterating on Mamba GPU
backward work. Verified formatting-only via diff sampling; no logic
changed.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
osobh
2026-08-10 07:09:36 -07:00
co-authored by Claude Sonnet 5
parent ad6405663f
commit 4aaa36a57a
305 changed files with 25537 additions and 18337 deletions
@@ -7,7 +7,11 @@ use rayon::prelude::*;
pub fn sum<const D: usize, E: CpuFloat>(
tensor: &CpuTensorPrimitive<D, E>,
) -> CpuTensorPrimitive<1, E> {
let sum = tensor.data.par_iter().copied().reduce(E::zero, |a, b| a + b);
let sum = tensor
.data
.par_iter()
.copied()
.reduce(E::zero, |a, b| a + b);
CpuTensorPrimitive::new(vec![sum], [1], tensor.device.clone())
}
@@ -47,7 +51,11 @@ pub fn sum_dim<const D: usize, E: CpuFloat>(
pub fn mean<const D: usize, E: CpuFloat>(
tensor: &CpuTensorPrimitive<D, E>,
) -> CpuTensorPrimitive<1, E> {
let sum = tensor.data.par_iter().copied().reduce(E::zero, |a, b| a + b);
let sum = tensor
.data
.par_iter()
.copied()
.reduce(E::zero, |a, b| a + b);
let mean = sum / E::from(tensor.numel()).unwrap();
CpuTensorPrimitive::new(vec![mean], [1], tensor.device.clone())
}
@@ -93,7 +101,12 @@ pub fn var<const D: usize, E: CpuFloat>(
tensor: &CpuTensorPrimitive<D, E>,
) -> CpuTensorPrimitive<1, E> {
let n = E::from(tensor.numel()).unwrap();
let mean = tensor.data.par_iter().copied().reduce(E::zero, |a, b| a + b) / n;
let mean = tensor
.data
.par_iter()
.copied()
.reduce(E::zero, |a, b| a + b)
/ n;
let variance = tensor
.data
.par_iter()