SciPy

scipy.fft.skip_backend

scipy.fft.skip_backend(backend)[source]

Context manager to skip a backend within a fixed scope.

Within the context of a with statement, the given backend will not be called. This covers backends registered both locally and globally. Upon exit, the backend will again be considered.

Parameters
backend: {object, ‘scipy’}

The backend to skip. Can either be a str containing the name of a known backend {‘scipy’}, or an object that implements the uarray protocol.

Examples

>>> import scipy.fft as fft
>>> fft.fft([1])  # Calls default scipy backend
array([1.+0.j])
>>> with fft.skip_backend('scipy'):  # We expicitly skip the scipy backend
...     fft.fft([1])                 # leaving no implementation available
Traceback (most recent call last):
    ...
BackendNotImplementedError: No selected backends had an implementation ...

Previous topic

scipy.fft.set_backend

Next topic

scipy.fft.set_global_backend