correlate(in1, in2, mode='full', method='auto')¶
Cross-correlate two N-dimensional arrays.
in2, with the output size determined by the
in1 (cupy.ndarray) – First input.
in2 (cupy.ndarray) – Second input. Should have the same number of dimensions as
mode (str) –
Indicates the size of the output:
'full': output is the full discrete linear convolution (default)
'valid': output consists only of those elements that do not rely on the zero-padding. Either
in2must be at least as large as the other in every dimension.
'same': - output is the same size as
in1, centered with respect to the
method (str) –
Indicates which method to use for the computations:
'direct': The convolution is determined directly from sums, the definition of convolution
'fft': The Fourier Transform is used to perform the convolution by calling
'auto': Automatically choose direct of FFT based on an estimate of which is faster for the arguments (default).
the result of correlation.
- Return type
method='auto', which calls
choose_conv_methodto choose the fastest method using pre-computed values. CuPy may not choose the same method to compute the convolution as SciPy does given the same inputs.