pub fn categorical_entropy(logits: &[f32]) -> f32
Compute entropy of a categorical distribution from logits.