Rate this Page
โ˜… โ˜… โ˜… โ˜… โ˜…

torch.lgamma#

torch.lgamma(input, *, out=None) โ†’ Tensor#

Computes the natural logarithm of the absolute value of the gamma function on input.

outi=lnโกโˆฃฮ“(inputi)โˆฃ\text{out}_{i} = \ln |\Gamma(\text{input}_{i})|
Parameters

input (Tensor) โ€“ the input tensor.

Keyword Arguments

out (Tensor, optional) โ€“ the output tensor.

Example:

>>> a = torch.arange(0.5, 2, 0.5)
>>> torch.lgamma(a)
tensor([ 0.5724,  0.0000, -0.1208])