Shortcuts

torch.lgamma

torch.lgamma(input, *, out=None) → Tensor

Computes the logarithm of the gamma function on input.

outi=logΓ(inputi)\text{out}_{i} = \log \Gamma(\text{input}_{i})
Parameters
  • input (Tensor) – the input tensor.

  • 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])

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources