快捷方式

torch.lgamma

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

計算 input 上 Gamma 函式絕對值的自然對數。

outi=lnΓ(inputi)\text{out}_{i} = \ln |\Gamma(\text{input}_{i})|
引數

input (Tensor) – 輸入張量。

關鍵字引數

out (Tensor, 可選) – 輸出張量。

示例

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

文件

查閱 PyTorch 的全面開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源