Skip to main content

rebind

Function rebind 

Source
pub fn rebind(name: &str, from: usize, to: usize) -> String
Expand description

The name layer to gives the tensor that layer from calls name. The hidden-state input is named by position (x for the first layer, xo{l-1} after); every per-layer tensor carries its layer’s index as a suffix (Wq0, x2n3); anything else — the shared RoPE tables (whose suffix is a rotation’s index, never a layer’s), the lowerings’ shared scalers — is the same tensor in every layer.

★ AND A DERIVED NAME CARRIES ITS PARENT’S INDEX IN THE MIDDLE. The blocked lowerings name their intermediates after the tensor they come from — xn0__xsq, od0_u — so the index is not at the end. Renaming only a trailing index left every such intermediate named after the REPRESENTATIVE layer in the manifest (xn0__xsq at layer 17), which no execution test sees because intermediates are computed, not bound. The part before the first _ is the name that carries the index.