fn
gammaln
→Tensorgammaln(x: Tensor)Natural logarithm of the absolute value of the gamma function.
Convenience alias for lucid.lgamma. Computes
with numerical stability for large
arguments where would itself overflow.
Parameters
xTensorInput tensor; any floating-point dtype.
Returns
Tensorelement-wise.
Notes
Definition:
For positive integer n, , so
gammaln(n) = log((n-1)!). gammaln returns +inf at
non-positive integers (poles of the gamma function).
Examples
>>> import lucid
>>> from lucid.special import gammaln
>>> gammaln(lucid.tensor([1.0, 5.0, 100.0]))
Tensor([0.0000, 3.1781, 359.1342])