convolve(a, v, mode="full")¶
Returns the discrete, linear convolution of two one-dimensional sequences.
If v is longer than a, the tensors are swapped before computation.
mode (str, optional) – By default, mode is ‘full’. This returns the convolution at each point of overlap, with an output shape of \((N+M-1,)\). At the end-points of the convolution, the signals do not overlap completely, and boundary effects may be seen. If mode is ‘same’, it returns output of length \(max(M, N)\). Boundary effects are still visible. If mode is ‘valid’, it returns output of length \(max(M, N) - min(M, N) + 1\). The convolution product is only given for points where the signals overlap completely. Values outside the signal boundary have no effect.
Tensor, discrete, linear convolution of a and v.
- Supported Platforms:
>>> import mindspore.numpy as np >>> output = np.convolve([1., 2., 3., 4., 5.], [2., 3.], mode="valid") >>> print(output) [ 7. 12. 17. 22.]