log_softmax

Function log_softmax 

Source
pub fn log_softmax(logits: &[f32]) -> Vec<f32>
Expand description

Pure-Rust distribution utilities for CPU-based sampling and log-prob. These are backend-independent helpers that can be used by any backend or for testing without a NN framework. Compute log(softmax(logits)) in a numerically stable way. Returns a vector of the same length as logits.