Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.lgamma function

PyTorch torch.lgamma function


PyTorch torch reference manual PyTorch torch reference manual

torch.lgamma is a function in PyTorch used to compute the logarithm of the gamma function.

Function definition

torch.lgamma(input, out=None)


Usage examples

Example

import

torch

Compute the logarithm of the gamma function

x

=

torch.

tensor

(

[

1.0

,

2.0

,

3.0

,

4.0

]

)

y

=

torch.

lgamma

(

x

)

print

(

"lgamma(x):"

,

y

)

The output is:

lgamma(x): tensor([0.0000, 0.0000, 0.6931, 1.7918])


PyTorch torch reference manual PyTorch torch reference manual