torch.linalg.slogdet
- torch.linalg.slogdet(A, *, out=None)
Computes the sign and natural logarithm of the absolute value of the determinant of a square matrix.
For complex
A, it returns the sign and the natural logarithm of the modulus of the determinant, that is, a logarithmic polar decomposition of the determinant.The determinant can be recovered as sign * exp(logabsdet). When a matrix has a determinant of zero, it returns (0, -inf).
Supports input of float, double, cfloat and cdouble dtypes. Also supports batches of matrices, and if is a batch of matrices then the output has the same batch dimensions.