Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Module « scipy.fft »

Fonction register_backend - module scipy.fft

Signature de la fonction register_backend

def register_backend(backend) 

Description

help(scipy.fft.register_backend)

Register a backend for permanent use.

Registered backends have the lowest priority and will be tried after the
global backend.

Parameters
----------
backend : {object, 'scipy'}
    The backend to use.
    Can either be a ``str`` containing the name of a known backend
    {'scipy'} or an object that implements the uarray protocol.

Raises
------
ValueError: If the backend does not implement ``numpy.scipy.fft``.

Examples
--------
We can register a new fft backend:

>>> from scipy.fft import fft, register_backend, set_global_backend
>>> class NoopBackend:  # Define an invalid Backend
...     __ua_domain__ = "numpy.scipy.fft"
...     def __ua_function__(self, func, args, kwargs):
...          return NotImplemented
>>> set_global_backend(NoopBackend())  # Set the invalid backend as global
>>> register_backend("scipy")  # Register a new backend
# The registered backend is called because
# the global backend returns `NotImplemented`
>>> fft([1])
array([1.+0.j])
>>> set_global_backend("scipy")  # Restore global backend to default



Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé