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
selective_scan_update_shape
def selective_scan_update_shape(state_in: T, x: T, dt: T, A: T, B: T, C: T, D: T, z: T, dt_bias: T) -> Tuple[IndexList[Int(3)], IndexList[Int(2)]]
Returns the output shapes for the selective_scan_update op.
The update step produces two tensors: the updated SSM state and the single-step output for the new token.
Args:
- state_in (
T): Input SSM state with shape(batch, dim, dstate). - x (
T): Input token with shape(batch, dim). - dt (
T): Time-delta tensor with shape(batch, dim). - A (
T): State transition matrix with shape(dim, dstate). - B (
T): Input matrix with shape(batch, n_groups, dstate). - C (
T): Output matrix with shape(batch, n_groups, dstate). - D (
T): Skip connection with shape(dim,). - z (
T): Gating tensor with shape(batch, dim). - dt_bias (
T): Time-delta bias with shape(dim,).
Returns:
Tuple[IndexList[Int(3)], IndexList[Int(2)]]: A tuple of (state_out_shape, output_shape) where state_out_shape
matches state_in.shape() and output_shape matches x.shape().