For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
causal_conv1d_varlen_fwd_shape
def causal_conv1d_varlen_fwd_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], conv_states: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=conv_states.static_spec], query_start_loc: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=query_start_loc.static_spec], cache_indices: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cache_indices.static_spec], has_initial_state: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=has_initial_state.static_spec]) -> IndexList[Int(2)]
Computes the output shape for the causal_conv1d_varlen_fwd graph op.
Parameters:
- βdtype (
DType): Element type of the conv input, weight, bias, and conv state tensors.
Args:
- βx (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=x.static_spec]): Input tensor of concatenated sequence elements with shape (dim, total_seqlen). - βweight (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=weight.static_spec]): Convolution weight tensor with shape (dim, width). - βbias (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=bias.static_spec]): Per-channel bias tensor with shape (dim,). - βconv_states (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=conv_states.static_spec]): Slot-indexed in/out pool of conv states with shape (batch, dim, width - 1). - βquery_start_loc (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=query_start_loc.static_spec]): Cumulative sequence lengths with shape (batch + 1,). - βcache_indices (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=cache_indices.static_spec]): Indices into the conv_states pool with shape (batch,). - βhas_initial_state (
ManagedTensorSlice[IOSpec[_, _].Input, static_spec=has_initial_state.static_spec]): Whether each sequence has an initial state with shape (batch,).
Returns: