ggml_ssm_scan_output: Views Into a Packed ssm_scan Result

View source: R/operations.R

ggml_ssm_scan_outputR Documentation

Views Into a Packed ssm_scan Result

Description

ggml_ssm_scan returns the outputs and the final states in one flat tensor. These helpers view either half with the right shape, so the offset arithmetic lives in one place: ggml_ssm_scan_output() yields the outputs shaped like x, and ggml_ssm_scan_state() the final states shaped like the leading n_seqs rows of s.

Usage

ggml_ssm_scan_output(ctx, result, x)

ggml_ssm_scan_state(ctx, result, s, ids)

Arguments

ctx

GGML context

result

The tensor returned by ggml_ssm_scan

x

The x passed to the scan (gives the output shape)

s

The s passed to the scan (gives the state shape)

ids

The ids passed to the scan (gives the sequence count)

Details

Both are graph views sharing memory with result; they add no computation. x, s and ids must be the same tensors the scan was built with, since their shapes are what the offsets are derived from.

Value

For ggml_ssm_scan_output(), a tensor shaped like x

For ggml_ssm_scan_state(), a tensor [d_state, head_dim, n_head, n_seqs]

See Also

Other state-space: ggml_gated_linear_attn(), ggml_gated_linear_attn_back(), ggml_rwkv_output(), 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()


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