route_from_logits

Function route_from_logits 

Source
pub fn route_from_logits(
    logits: &[f32],
    tokens: usize,
    bias: &[f32],
    c: &MoeV41Cfg,
) -> (Vec<f32>, Vec<usize>)
Expand description

The reference’s Gate.forward on f32 logits: returns (weights[tokens, topk], indices[tokens, topk]) in torch’s top-k order.