Skip to main content

contract_mean

Function contract_mean 

Source
pub fn contract_mean(
    e: &Engine,
    topology: &HyperTopology,
    x: &CudaSlice<f32>,
    t: usize,
    hidden: usize,
) -> Result<CudaSlice<f32>, Box<dyn Error>>
Expand description

UNWEIGHTED stream-mean contraction [tokens, streams, hidden] -> [tokens, hidden] — the hc_contract the glm5 DFlash2 drafter’s aux-hidden features are defined by (the probe’s capture seam: mean over the hc_mult stream blocks of the completed layer output, == the SGLang glm5_next integration’s pinned definition). Deliberately NOT keyed on topology.collapse: the drafter contract is the mean by definition, whatever the trunk exit does (for glm5_next the exit IS Mean, so this is also the collapse kernel).