code: def _fftconv_faster(x, h, mode):
      """
      See if using `fftconvolve` or `_correlateND` is faster. The boolean value
      returned depends on the sizes and shapes of the input values.
  
      The big O ratios were found to hold across different machines, which makes
      sense as it's the ratio that matters (the effective speed of the computer
      is found in both big O constants). Regardless, this had been tuned on an
      early 2015 MacBook Pro with 8GB RAM and an Intel i5 processor.
      """
      if mode == "full":
          out_shape = [n + k - 1 for n, k in zip(x.shape, h.shape)]
          big_O_constant = (
              10963.92823819 if x.ndim == 1 else 8899.1104874
          )
      elif mode == "same":
          out_shape = x.shape
          if x.ndim == 1:
              if h.size <= x.size:
                  big_O_constant = 7183.41306773
              else:
                  big_O_constant = 856.78174111
          else:
              big_O_constant = 34519.21021589
      elif mode == "valid":
          out_shape = [n - k + 1 for n, k in zip(x.shape, h.shape)]
          big_O_constant = (
              41954.28006344 if x.ndim == 1 else 66453.24316434
          )
      else:
          raise ValueError(
              "Acceptable mode flags are \
                           'valid',"
              " 'same', or 'full'."
          )
  
      # see whether the Fourier transform convolution method or the direct
      # convolution method is faster (discussed in scikit-image PR #1792)
      direct_time = x.size * h.size * _prod(out_shape)
      fft_time = sum(
          n * np.log(n) for n in (x.shape + h.shape + tuple(out_shape))
      )
  
      return big_O_constant * fft_time < direct_time
  
file_path: cusignal/python/cusignal/convolution/convolution_utils.py
imports: import timeit
  import cupy
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: _fftconv_faster(x, h, mode) and returns: unknown