ggml_rwkv_output: Views Into a Packed RWKV / GLA Result

View source: R/operations.R

ggml_rwkv_outputR Documentation

Views Into a Packed RWKV / GLA Result

Description

ggml_rwkv_wkv6, ggml_rwkv_wkv7 and ggml_gated_linear_attn all return one [S * H, n_tokens + S * n_seqs] tensor holding the per-token outputs followed by the final state. These helpers view either half, so the column arithmetic lives in one place rather than at every call site.

Usage

ggml_rwkv_output(ctx, result, k)

ggml_rwkv_state(ctx, result, k, state)

Arguments

ctx

GGML context

result

The tensor returned by one of the RWKV / GLA ops

k

The k passed to that op (gives S, H and the token count)

state

The state passed to that op (gives the sequence count)

Details

Both are graph views sharing memory with result and add no computation. k must be the same tensor the op was built with, since S, H and n_tokens are read from it.

Value

For ggml_rwkv_output(), a tensor [S * H, n_tokens]

For ggml_rwkv_state(), a tensor [S * H, S * n_seqs]

See Also

Other state-space: ggml_gated_linear_attn(), ggml_gated_linear_attn_back(), ggml_rwkv_wkv6(), ggml_rwkv_wkv6_back(), ggml_rwkv_wkv7(), ggml_rwkv_wkv7_back(), ggml_ssm_conv(), ggml_ssm_conv_back(), ggml_ssm_scan(), ggml_ssm_scan_back(), ggml_ssm_scan_output()


ggmlR documentation built on Oct. 23, 2026, 1:07 a.m.