Skip to main content

moe_topk_route

Function moe_topk_route 

Source
pub fn moe_topk_route(
    logits: &[f32],
    top_k: usize,
    use_sigmoid: bool,
) -> Result<(Vec<usize>, Vec<f32>), EngineError>
Expand description

Softmax (or sigmoid) top-k MoE routing. Returns (expert_ids, normalized weights).