braindecode.functional.fft_conv1d#
- braindecode.functional.fft_conv1d(x, weight, bias=None)[source]#
F.conv1d(x, weight, bias, padding="same")computed with FFTs.Equal to the direct convolution up to float rounding: the FFT is long enough for a linear (not circular) convolution. Its cost barely grows with the kernel size, so it is faster than the direct one for long kernels on CPU (see
prefer_fft_conv()). float16/bfloat16 inputs are computed in float32 (spectral_input()) and cast back.- Parameters:
- Returns:
Output of shape
(batch, out_channels, n_times), dtype and device ofx. For an evenkernel_sizeit is aligned like torch’spadding="same"(the extra zero padded on the right).- Return type: