For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
CausalConv1DVarlenStates
struct CausalConv1DVarlenStates
Extract conv states from variable-length sequences.
Extracts the last state_len elements from each sequence to initialize conv_state for subsequent autoregressive generation.
Tensor Shapes: - states: (batch, dim, state_len) - Output states tensor - x: (total_tokens, dim) - Input tensor (concatenated sequences) - cu_seqlens: (batch + 1,) - Cumulative sequence lengths
Implemented traitsβ
AnyType,
ImplicitlyDestructible
Methodsβ
executeβ
static execute[dtype: DType, target: StringSlice[StaticConstantOrigin]](states: ManagedTensorSlice[Output, static_spec=states.static_spec], x: ManagedTensorSlice[Input, static_spec=x.static_spec], cu_seqlens: ManagedTensorSlice[Input, static_spec=cu_seqlens.static_spec], ctx: DeviceContext)
shapeβ
static shape[dtype: DType](x: ManagedTensorSlice[Input, static_spec=x.static_spec], cu_seqlens: ManagedTensorSlice[Input, static_spec=cu_seqlens.static_spec]) -> IndexList[3]
Returns:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!