skip_backend#
- scipy.fft.skip_backend(backend)[source]#
Context manager to skip a backend within a fixed scope.
Within the context of a
withstatement, the given backend will not be called. This covers backends registered both locally and globally. Upon exit, the backend will again be considered.Deprecated since version 2.0: The use of uarray to control the FFT backend is deprecated as of SciPy 2.0 and will be removed in SciPy 2.2. See Array API coverage for details on using alternative array types through the Python array API standard.
- Parameters:
- backend{object, ‘scipy’}
The backend to skip. Can either be a
strcontaining the name of a known backend {‘scipy’} or an object that implements the uarray protocol.
- Returns:
- contextuarray._SetBackendContext
Context manager that skips the backend.
Notes
Array API Standard Support
skip_backendis not in-scope for support of Python Array API Standard compatible backends other than NumPy.See Support for the array API standard for more information.
Examples
>>> import scipy.fft as fft >>> fft.fft([1]) # Calls default SciPy backend array([1.+0.j]) >>> with fft.skip_backend('scipy'): # We explicitly skip the SciPy backend ... fft.fft([1]) # leaving no implementation available Traceback (most recent call last): ... BackendNotImplementedError: No selected backends had an implementation ...