gammaln

paddle. gammaln ( x: Tensor, name: str | None = None ) Tensor [source]

Calculates the logarithm of the absolute value of the gamma function elementwisely.

Parameters
  • x (Tensor) – Input Tensor. Must be one of the following types: float16, float32, float64, bfloat16.

  • name (str|None, optional) – Name for the operation (optional, default is None). For more information, please refer to api_guide_Name.

Returns

Tensor, The values of the logarithm of the absolute value of the gamma at the given tensor x.

Examples

>>> import paddle

>>> x = paddle.arange(1.5, 4.5, 0.5)
>>> out = paddle.gammaln(x)
>>> print(out)
Tensor(shape=[6], dtype=float32, place=Place(cpu), stop_gradient=True,
    [-0.12078224,  0.        ,  0.28468287,  0.69314718,  1.20097363,
        1.79175949])