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_varlen_update_shape

def causal_conv1d_varlen_update_shape[dtype: DType](x: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=x.static_spec], weight: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=weight.static_spec], bias: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=bias.static_spec], cache_seqlens: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cache_seqlens.static_spec], conv_state_indices: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=conv_state_indices.static_spec]) -> IndexList[Int(3)]

Returns the output shape for the causal_conv1d_varlen_update op.

The output shape equals the input shape (batch, dim, seqlen).

Parameters:

  • ​dtype (DType): Element type of the x, weight, and bias input tensors.

Args:

  • ​x (ManagedTensorSlice[IOSpec[_, _].Input, static_spec=x.static_spec]): Input tensor with shape (batch, dim, seqlen).
  • ​weight (ManagedTensorSlice[IOSpec[_, _].Input, static_spec=weight.static_spec]): Convolution weights with shape (dim, width).
  • ​bias (ManagedTensorSlice[IOSpec[_, _].Input, static_spec=bias.static_spec]): Per-channel bias with shape (dim,).
  • ​cache_seqlens (ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cache_seqlens.static_spec]): Current sequence lengths per batch entry with shape (batch,).
  • ​conv_state_indices (ManagedTensorSlice[IOSpec[_, _].Input, static_spec=conv_state_indices.static_spec]): Indices into the conv state buffer with shape (batch,).

Returns:

IndexList[Int(3)]: The output tensor shape, equal to x.shape().