Skip to main content

check_scale_bindings

Function check_scale_bindings 

Source
pub fn check_scale_bindings(scheme: &QuantScheme, bindings: usize)
Expand description

Panic when the scale bindings and the scheme’s levels disagree.

Every level binds a scale buffer of its own, so nothing ties the bindings to the scheme: a missing level is dropped from the reconstruction and every value comes back short by that factor, an extra one is a caller quantizing differently than the scheme it passed.

The global level is further constrained by what this reader serves: it binds as f32 rather than being read as f32 bytes. It has one scale for the whole tensor, so a narrower type saves nothing and only reintroduces rounding error.