- class torchaudio.transforms.FFTConvolve(mode: str = 'full')¶
Convolves inputs along their last dimension using FFT. For inputs with large last dimensions, this module is generally much faster than
Convolve. Note that, in contrast to
torch.nn.Conv1d, which actually applies the valid cross-correlation operator, this module applies the true convolution operator. Also note that this module can only output float tensors (int tensor inputs will be cast to float).
mode (str, optional) –
Must be one of (“full”, “valid”, “same”).
”full”: Returns the full convolution result, with shape (…, N + M - 1), where N and M are the trailing dimensions of the two inputs. (Default)
”valid”: Returns the segment of the full convolution result corresponding to where the two inputs overlap completely, with shape (…, max(N, M) - min(N, M) + 1).
”same”: Returns the center segment of the full convolution result, with shape (…, N).
- forward(x: Tensor, y: Tensor) Tensor ¶
Result of convolving
y, with shape (…, L), where the leading dimensions match those of
xand L is dictated by
- Return type: