IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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_shape

def causal_conv1d_shape[dtype: DType, rank: Int](input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], weight: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=weight.static_spec], bias: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=bias.static_spec]) -> IndexList[rank]

Returns the output shape for the causal_conv1d op.

Causal 1D convolution preserves the input shape: output has the same (batch, channels, seqlen) as input.

Parameters:

  • ​dtype (DType): Element type of the input, weight, and bias tensors.
  • ​rank (Int): Tensor rank of the input and output, expected to be 3.

Args:

  • ​input (ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec]): Input tensor with shape (batch, channels, seqlen).
  • ​weight (ManagedTensorSlice[IOSpec[_, _].Input, static_spec=weight.static_spec]): Convolution weights with shape (channels, width).
  • ​bias (ManagedTensorSlice[IOSpec[_, _].Input, static_spec=bias.static_spec]): Per-channel bias with shape (channels,).

Returns:

IndexList[rank]: The output tensor shape, equal to input.shape().