Skip to main content

causal_conv1d_prefill_silu

Function causal_conv1d_prefill_silu 

Source
pub fn causal_conv1d_prefill_silu(
    input: &[f32],
    weight: &[f32],
    bias: &[f32],
    batch: usize,
    channels: usize,
    kernel_size: usize,
    input_length: usize,
    output_length: usize,
) -> (Vec<f32>, Vec<f32>)
Expand description

Depthwise causal conv1d sequence prefill from an implicit zero state.

input and out use [batch, channels, time] layout. For each output position, values before the beginning of the sequence are zero-padded. The returned state is the final [batch, channels, kernel_size] rolling window, also left-padded with zeros when the input is shorter than the kernel.