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
CausalConv1DUpdate
struct CausalConv1DUpdate[activation: StringSlice[StaticConstantOrigin]]
Incremental causal conv1d update for autoregressive decoding.
This operation accepts the previous conv_state as an input and produces the updated conv_state as a separate output, compatible with functional graph semantics (no in-place mutation).
Tensor Shapes: Outputs: - output: (batch, channels, seqlen) - Convolution output. - conv_state_out: (batch, channels, state_len) - Updated state. Inputs: - input: (batch, channels, seqlen) - New input tokens. - conv_state_in: (batch, channels, state_len) - Previous state. - weight: (channels, width) - Convolution weights. - bias: (channels,) - Per-channel bias.
Parametersβ
- βactivation (
StringSlice[StaticConstantOrigin]): "none" or "silu" - activation function to apply.
Implemented traitsβ
AnyType,
ImplicitlyDestructible
Methodsβ
executeβ
static execute[dtype: DType, rank: Int, target: StringSlice[StaticConstantOrigin]](output: ManagedTensorSlice[Output, static_spec=output.static_spec], conv_state: ManagedTensorSlice[Output, static_spec=conv_state.static_spec], input: ManagedTensorSlice[Input, static_spec=input.static_spec], conv_state_in: ManagedTensorSlice[Input, static_spec=conv_state_in.static_spec], weight: ManagedTensorSlice[Input, static_spec=weight.static_spec], bias: ManagedTensorSlice[Input, static_spec=bias.static_spec], ctx: DeviceContext)
shapeβ
static shape[dtype: DType, rank: Int](input: ManagedTensorSlice[Input, static_spec=input.static_spec], conv_state_in: ManagedTensorSlice[Input, static_spec=conv_state_in.static_spec], weight: ManagedTensorSlice[Input, static_spec=weight.static_spec], bias: ManagedTensorSlice[Input, static_spec=bias.static_spec]) -> Tuple[IndexList[rank], IndexList[rank]]
Returns:
Tuple[IndexList[rank], IndexList[rank]]
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!