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
CausalConv1D
struct CausalConv1D[activation: StringSlice[StaticConstantOrigin]]
Causal 1D convolution operation with bias.
Performs causal (autoregressive) 1D convolution where each output position depends only on current and past input positions. Supports optional SiLU activation with SIMD-vectorized implementations for widths 1, 2, 3, 4.
Tensor Shapes: - input: (batch, channels, seqlen) - Input sequence tensor. - weight: (channels, width) - Convolution weights per channel. - bias: (channels,) - Per-channel bias to add. - output: (batch, channels, seqlen) - Output tensor (same shape as input).
Parametersβ
- βactivation (
StringSlice[StaticConstantOrigin]): Activation function to apply after convolution.- "none": No activation (identity).
- "silu": SiLU/Swish activation (x * sigmoid(x)).
Implemented traitsβ
AnyType,
ImplicitlyDestructible
Methodsβ
executeβ
static execute[dtype: DType, rank: Int, target: StringSlice[StaticConstantOrigin]](output: ManagedTensorSlice[Output, static_spec=output.static_spec], input: ManagedTensorSlice[Input, static_spec=input.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], weight: ManagedTensorSlice[Input, static_spec=weight.static_spec], bias: ManagedTensorSlice[Input, static_spec=bias.static_spec]) -> IndexList[rank]
Returns:
IndexList[rank]
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!