pub trait DeltaReducer {
// Required method
fn reduce_key(
&self,
key: &str,
contributions: &[Contribution],
) -> Result<(Tensor, Tensor), Error>;
}Expand description
Order-independent N-way delta reducer.
Implementors merge an explicit contributor set into a fixed-rank delta. The
stack + truncated-SVD implementation is StackSvdReducer; the trait keeps
it swappable (held-out-eval variants, future native reducers).
Required Methods§
Sourcefn reduce_key(
&self,
key: &str,
contributions: &[Contribution],
) -> Result<(Tensor, Tensor), Error>
fn reduce_key( &self, key: &str, contributions: &[Contribution], ) -> Result<(Tensor, Tensor), Error>
Reduce contributors for a single layer key into fixed-rank factors
(A_out [R, in], B_out [out, R]), with the result expressed at
scaling = 1.0 (weights + per-contributor scaling already folded in).
All tensors stay on contributions[*].lora_a.device() (must be uniform).