16 lines
619 B
Rust
16 lines
619 B
Rust
//! Output shared by the KAR preparation commands.
|
|
|
|
use leleka_control_plane::prepare_preview;
|
|
|
|
pub(super) fn print_top_tensor_distortions(distortions: &[prepare_preview::TensorDistortion]) {
|
|
let mut ranked = distortions.iter().collect::<Vec<_>>();
|
|
ranked.sort_by(|a, b| b.relative_l2.total_cmp(&a.relative_l2));
|
|
println!("highest relative L2 by KAR record (top 20 of {}):", ranked.len());
|
|
for tensor in ranked.into_iter().take(20) {
|
|
println!(
|
|
" {:.8} kind={} bytes={} {}",
|
|
tensor.relative_l2, tensor.source_kind, tensor.section_bytes, tensor.name
|
|
);
|
|
}
|
|
}
|