Skip to main content

Module decoder

Module decoder 

Source

Structs§

ConstrainedDecoder

Functions§

apply_mask
Applies a boolean constraint mask to log-probabilities. Invalid tokens (mask == false) are set to f64::NEG_INFINITY. Input / output shape: [B][M][|V|].
beam_search
Beam search selection over masked log-probabilities.
constrained_beam_decode
Runs the full decode loop using a static flat logit vector (same logits repeated for every batch entry, beam, and step). Useful for unit tests where the model is not available.
log_softmax_1d
Numerically stable log-softmax over a single 1-D slice.
log_softmax_3d
Numerically stable log-softmax over the last axis. Input / output shape: [B][M][|V|].