@@ -384,8 +384,11 @@ def convolve(a, v, mode="full", method="auto"):
384384 probability theory, the sum of two independent random variables is
385385 distributed according to the convolution of their individual
386386 distributions.
387+
387388 If `v` is longer than `a`, the arrays are swapped before computation.
389+
388390 For full documentation refer to :obj:`numpy.convolve`.
391+
389392 Parameters
390393 ----------
391394 a : {dpnp.ndarray, usm_ndarray}
@@ -407,6 +410,8 @@ def convolve(a, v, mode="full", method="auto"):
407410 ``max(M, N) - min(M, N) + 1``. The convolution product is only given
408411 for points where the signals overlap completely. Values outside
409412 the signal boundary have no effect.
413+
414+ Default: ``'full'``.
410415 method : {'auto', 'direct', 'fft'}, optional
411416 'direct':
412417 The convolution is determined directly from sums.
@@ -416,14 +421,18 @@ def convolve(a, v, mode="full", method="auto"):
416421 'auto':
417422 Automatically chooses direct or Fourier method based on
418423 an estimate of which is faster.
424+
419425 Note: Use of the FFT convolution on input containing NAN or INF
420426 will lead to the entire output being NAN or INF.
421427 Use method='direct' when your input contains NAN or INF values.
428+
422429 Default: ``'auto'``.
430+
423431 Returns
424432 -------
425433 out : ndarray
426434 Discrete, linear convolution of `a` and `v`.
435+
427436 See Also
428437 --------
429438 :obj:`dpnp.correlate` : Cross-correlation of two 1-dimensional sequences.
@@ -437,26 +446,33 @@ def convolve(a, v, mode="full", method="auto"):
437446 circular convolution). Since multiplication is more efficient (faster)
438447 than convolution, the function implements two approaches - direct and fft
439448 which are regulated by the keyword `method`.
449+
440450 References
441451 ----------
442452 .. [1] Wikipedia, "Convolution",
443453 https://en.wikipedia.org/wiki/Convolution
454+
444455 Examples
445456 --------
446457 Note how the convolution operator flips the second array
447458 before "sliding" the two across one another:
459+
448460 >>> import dpnp as np
449461 >>> a = np.array([1, 2, 3], dtype=np.float32)
450462 >>> v = np.array([0, 1, 0.5], dtype=np.float32)
451463 >>> np.convolve(a, v)
464+
452465 array([0. , 1. , 2.5, 4. , 1.5], dtype=float32)
453466 Only return the middle values of the convolution.
454467 Contains boundary effects, where zeros are taken
455468 into account:
469+
456470 >>> np.convolve(a, v, 'same')
471+
457472 array([1. , 2.5, 4. ], dtype=float32)
458473 The two arrays are of the same length, so there
459474 is only one position where they completely overlap:
475+
460476 >>> np.convolve(a, v, 'valid')
461477 array([2.5], dtype=float32)
462478 """
0 commit comments