Improve _fft_convolve
@@ -65,13 +65,13 @@ def _fft_convolve(a1, a2, mode):
dtype = cupy.result_type(a1, a2)
n1, n2 = a1.size, a2.size
- out_size = n1 + n2 - 1
+ out_size = core.internal.clp2(n1 + n2 - 1)
fa1 = fft(a1, out_size)
fa2 = fft(a2, out_size)
out = ifft(fa1 * fa2, out_size)
if mode == 'full':
- start, end = None, None
+ start, end = 0, n1 + n2 - 1
elif mode == 'same':
start = (n2 - 1) // 2
end = start + n1
