causal_fftconv1d_fp32_blh#
- causal_fftconv1d_fp32_blh(x, kernel, shortcut=None)#
Causal 1D FFT convolution (BLH layout, channels-last) with optional shortcut.
Computes \(y[n] = \sum_{m=0}^{n} x[n-m]\, k[m]\) per channel via the FFT path:
\[y = \mathcal{F}^{-1}\bigl(\mathcal{F}_F(x) \odot \mathcal{F}_F(k)\bigr)[\,:L\,]\]where \(F = \min(L + K, 2L)\) is the zero-pad length that prevents wrap-around. Causality is enforced implicitly by keeping only the leading
Lsamples of the inverse FFT (no future taps leak into positionn).When
shortcutis provided, the per-channel residual is added:\[y \leftarrow y + \text{shortcut} \odot x\]- Parameters:
- Returns:
Output tensor of shape
[batch_size, seq_len, hidden_dim]in the original dtype ofx.- Return type: