xlnstorch.implements_sbdb#
- xlnstorch.implements_sbdb(key, default=False)#
A decorator to register a custom sbdb implementation. This will be used to compute/approximate the Gaussian logarithms for the addition and subtraction operations in the logarithmic domain. See
https://en.wikipedia.org/wiki/Logarithmic_number_system https://en.wikipedia.org/wiki/Gaussian_logarithm
- Parameters:
key (str) – The key to register the sbdb function under. This should be unique across all sbdb implementations.
default (bool, optional) – If True, this sbdb function will be set as the default sbdb implementation. If multiple sbdb functions are registered with default=True, the last one registered will be used as the default. Defaults to False.
- Raises:
ValueError – If an sbdb function with the given key is already registered.