tf.keras.ops.slogdet

Compute the sign and natural logarithm of the determinant of a matrix.

x Input matrix. It must 2D and square.

A tuple (sign, logabsdet). sign is a number representing the sign of the determinant. For a real matrix, this is 1, 0, or -1. For a complex matrix, this is a complex number with absolute value 1 (i.e., it is on the unit circle), or else 0. logabsdet is the natural log of the absolute value of the determinant.