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 function
causal_conv1d_varlen_states_shape
def causal_conv1d_varlen_states_shape[dtype: DType](x: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=x.static_spec], cu_seqlens: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cu_seqlens.static_spec]) -> IndexList[Int(3)]
Returns the output shape for the causal_conv1d_varlen_states op.
The output is a state buffer with one entry per sequence: shape
(batch, dim, state_len). The state_len dimension is determined by
the output allocation at runtime; this function returns 0 for that
dimension as a placeholder.
Parameters:
- โdtype (
DType): Element type of the packed input tensorx.
Args:
- โx (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=x.static_spec]): Packed input tensor with shape(total_tokens, dim). - โcu_seqlens (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cu_seqlens.static_spec]): Cumulative sequence lengths with shape(batch + 1,).
Returns:
IndexList[Int(3)]: The output state shape (batch, dim, 0) where batch is inferred
from cu_seqlens and state_len is filled at runtime.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!