fftconv1d_fp32_blh#
- fftconv1d_fp32_blh(x, kernel, shortcut=None)#
Non-causal 1D FFT convolution (BLH layout, channels-last) with optional shortcut.
Computes a “same”-aligned linear convolution per channel by zero-padding to \(F = \min(L + \lceil K/2 \rceil, 2L)\), multiplying in the frequency domain, inverting, and cropping centered with offset
K // 2. The non-causal variant only needs enough headroom for half the kernel on each side, so it is cheaper than the causal variant.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: