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
varlen_selective_state_update_shape
def varlen_selective_state_update_shape(x: T, dt: T, A: T, B: T, C: T, D: T, z: T, dt_bias: T, state_batch_indices: T) -> Tuple[IndexList[Int(4)], IndexList[Int(3)]]
Returns the output shapes for the varlen_selective_state_update op.
The update produces the updated SSM state and the single-step output.
Args:
- x (
T): Input tensor with shape(batch, nheads, dim). - dt (
T): Time-delta tensor with shape(batch, nheads, dim). - A (
T): State transition matrix with shape(nheads, dim, dstate). - B (
T): Input matrix with shape(batch, ngroups, dstate). - C (
T): Output matrix with shape(batch, ngroups, dstate). - D (
T): Skip connection with shape(nheads, dim). - z (
T): Gating tensor with shape(batch, nheads, dim). - dt_bias (
T): Time-delta bias with shape(nheads, dim). - state_batch_indices (
T): Batch indices into the state buffer with shape(batch,).
Returns:
Tuple[IndexList[Int(4)], IndexList[Int(3)]]: A tuple (state_shape, output_shape) where state_shape is
(batch, nheads, dim, dstate) and output_shape matches x.shape().