conv_partial¶
- dnois.fourier.conv_partial(f1: Tensor, f2_ft: Tensor, f2_shape: Sequence[int], dims: Sequence[int], real: bool, out: Literal['full', 'same', 'valid'] = 'full', padding: int | Sequence[int] | str = 'linear', simpson: bool = True) Tensor ¶
See
conv_mult()
. DFT-scale is not applied here.- Parameters:
f1 (Tensor) – The first tensor for convolution.
f2_ft (Tensor) – The FFT of the second tensor for convolution. Typically produced by
ft4conv()
.f2_shape (Sequence[int]) – Shape of original second tensor. This is needed to ensure correct padding.
dims (Sequence[int]) – Dimensions to be convolved.
real (bool) – Whether to use FFT for real tensors to
f1
. This should be consistent with that forf2_ft
.out (str) – See
dconv()
.padding (int, Sequence[int] or str) – See
dconv()
.simpson (bool) – Whether to apply Simpson’s rule to
f1
before FFT. Default:True
.
- Returns:
Convolution between
f1
andf2
(whose FFT isf2_ft
). Seedconv()
for descriptions about its dtype and shape.