Skip to main content

Sampler

Trait Sampler 

Source
pub trait Sampler {
    // Required method
    fn sample(&mut self, logits: &[f32]) -> u32;
}
Expand description

Chooses the next token id from one row of logits (length vocab_size).

Required Methods§

Source

fn sample(&mut self, logits: &[f32]) -> u32

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§