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_scan_fwd_shape
def varlen_selective_scan_fwd_shape(u: T, delta: T, A: T, B: T, C: T, D: T, delta_bias: T, query_start_loc: T, cache_indices: T, has_initial_state: T) -> IndexList[Int(2)]
Returns the output shape for the varlen_selective_scan_fwd op.
The variable-length selective scan output has the same shape as the
packed input u: (dim, total_length).
Args:
- u (
T): Packed input tensor with shape(dim, total_length). - delta (
T): Time-step tensor with shape(dim, total_length). - A (
T): State transition matrix with shape(dim, dstate). - B (
T): Input projection with shape(ngroups, dstate, total_length). - C (
T): Output projection with shape(ngroups, dstate, total_length). - D (
T): Skip connection with shape(dim,). - delta_bias (
T): Delta bias with shape(dim,). - query_start_loc (
T): Cumulative sequence lengths with shape(batch + 1,). - cache_indices (
T): Indices into SSM states with shape(batch,). - has_initial_state (
T): Boolean mask with shape(batch,).
Returns:
IndexList[Int(2)]: The output tensor shape (dim, total_length).