xtensor.signal – Signal processing operations#

pytensor.xtensor.signal.convolve1d(in1, in2, mode='full', *, dims)[source]#

Convolve two arrays along a single dimension.

Convolve in1 and in2, with the output size determined by the mode argument.

Parameters:
  • in1 (XTensorVariable) – First input.

  • in2 (XTensorVariable) – Second input.

  • mode ({'full', 'valid', 'same'}, optional) – A string indicating the size of the output: - ‘full’: The output is the full discrete linear convolution of the inputs, with shape (…, N+M-1,). - ‘valid’: The output consists only of elements that do not rely on zero-padding, with shape (…, max(N, M) - min(N, M) + 1,). - ‘same’: The output is the same size as in1, centered with respect to the ‘full’ output.

  • dims (tuple[str, str]) – The dimension along which to convolve each of the inputs. Must be unique to each input. The left dimension will be present in the output.

Returns:

out – The discrete linear convolution of in1 with in2.

Return type:

XTensorVariable