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_fwd_shape
def selective_scan_fwd_shape(u: T, delta: T, A: T, B: T, C: T, D: T, z: T, delta_bias: T) -> IndexList[Int(3)]
Returns the output shape for the selective_scan_fwd op.
The output of a selective scan forward pass has the same shape as the
input sequence u: (batch, dim, seqlen).
Args:
- u (
T): Input sequence tensor with shape(batch, dim, seqlen). - delta (
T): Time-step tensor with shape(batch, dim, seqlen). - A (
T): State transition matrix with shape(dim, dstate). - B (
T): Input projection with shape(batch, n_groups, dstate, seqlen). - C (
T): Output projection with shape(batch, n_groups, dstate, seqlen). - D (
T): Skip connection with shape(dim,). - z (
T): Gating tensor with shape(batch, dim, seqlen). - delta_bias (
T): Delta bias with shape(dim,).
Returns:
IndexList[Int(3)]: The shape of the output tensor (batch, dim, seqlen).