flashinfer.gdn_paged.gated_delta_rule_decode_paged

flashinfer.gdn_paged.gated_delta_rule_decode_paged(q: Tensor, k: Tensor, v: Tensor, A_log: Tensor, a: Tensor, dt_bias: Tensor, b: Tensor, scale: float | None = None, output: Tensor | None = None, use_qk_l2norm: bool = True, *, state_pool: Tensor, page_indices: Tensor, page_indptr: Tensor, last_page_len: Tensor, backend: Literal['auto', 'flashinfer', 'cake_gdn', 'rubin'] = 'auto', slots: GDNPagedDecodeSlots | None = None) → Tensor

Single-token GDN decode on a paged recurrent-state pool.

The decoded token is the last token of its sequence: it sits at position last_page_len[b] of the sequence’s last page. When the token opens a new page (last_page_len[b] == 1) the state is read from the previous page and written to the new one, so the previous page, which may be a shared full page, is not modified. Otherwise the last page is read and updated in place.

Parameters:
Returns:

The output [B, 1, HV, V].

Return type:

torch.Tensor

Notes

Every sequence must hold at least one token before the decoded one, so a sequence whose decoded token opens a new page owns at least two pages.