cupynumeric.convolve#

cupynumeric.convolve(
a: ndarray,
v: ndarray,
mode: ConvolveMode = 'full',
method: ConvolveMethodType = 'auto',
) ndarray#

Returns the discrete, linear convolution of two ndarrays.

If a and v are both 1-D and v is longer than a, the two are swapped before computation. For N-D cases, the arguments are never swapped.

Parameters:
  • a ((N,) array_like) – First input ndarray.

  • v ((M,) array_like) – Second input ndarray.

  • mode ({'full', 'valid', 'same'}, optional) –

    ‘same’:

    The output is the same size as a, centered with respect to the ‘full’ output. (default)

    ’full’:

    The output is the full discrete linear convolution of the inputs.

    ’valid’:

    The output consists only of those elements that do not rely on the zero-padding. In ‘valid’ mode, either a or v must be at least as large as the other in every dimension.

  • method ({'auto', 'direct', 'fft'}, optional) –

    A string indicating which method to use to calculate the convolution.

    ’auto’:

    Automatically chooses direct or Fourier method based on an estimate of which is faster (default)

    ’direct’:

    The convolution is determined directly from sums, the definition of convolution

    ’fft’:

    The Fourier Transform is used to perform the convolution

Returns:

out – Discrete, linear convolution of a and v.

Return type:

ndarray

See also

numpy.convolve

Notes

The current implementation only supports the ‘same’ mode.

Unlike numpy.convolve, cupynumeric.convolve supports N-dimensional inputs, but it follows NumPy’s behavior for 1-D inputs.

Availability:

Multiple GPUs, Multiple CPUs