pyhf.get_backend#

pyhf.get_backend(default: bool = False) tuple[pyhf.typing.TensorBackend, pyhf.typing.Optimizer][source]#

Get the current backend and the associated optimizer

Example

>>> import pyhf
>>> pyhf.set_backend("numpy")
>>> backend, optimizer = pyhf.get_backend()
>>> backend
<pyhf.tensor.numpy_backend.numpy_backend object at 0x...>
>>> optimizer
<pyhf.optimize.scipy_optimizer object at 0x...>
Parameters:

default (bool) – Return the default backend or not

Returns:

backend, optimizer