tf.keras.ops.lgamma

Computes the natural log of the absolute value of the Gamma function.

lgamma(x) = log(|Gamma(x)|)

x Input tensor.

A tensor with the same shape and floating-point dtype as x.

Example:

x = np.array([1.0, 2.0, 3.0, 4.0])
keras.ops.lgamma(x)
array([0.       , 0.       , 0.6931472, 1.7917595], dtype=float32)