For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
dispatch_relative_logits_mask
def dispatch_relative_logits_mask[dtype: DType, BiasLayout: TensorLayout, bias_origin: ImmOrigin, CacheLengthsLayout: TensorLayout, cache_lengths_origin: ImmOrigin, RowOffsetsLayout: TensorLayout, row_offsets_origin: ImmOrigin, //, local_window_size: Int = Int(-1)](bias_nd: TileTensor[dtype, BiasLayout, bias_origin], cache_lengths: TileTensor[.uint32, CacheLengthsLayout, cache_lengths_origin], input_row_offsets: TileTensor[.uint32, RowOffsetsLayout, row_offsets_origin], callback_fn: T)
Wrap bias_nd in a RelativeLogitsMask and invoke callback_fn.
This carries runtime state (the bias table plus the tensors that recover
its ragged-flat row), so it lives
outside dispatch_mask's zero-arg string dispatch. local_window_size
picks the visibility mask: <= 0 (canonically -1, the graph-level
"no window" value) -> CausalMask, else
SlidingWindowCausalMask[local_window_size]. The mask structs
themselves report "no window" as sliding_window_size() == 0; this
function is where the two conventions meet.