latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.linalg.matrix_rank
- tensorplay.linalg.matrix_rank(A, *, atol=None, rtol=None, hermitian=False)[source]
Computes the numerical rank of each matrix in
A.A singular value counts towards the rank when it exceeds the sum of an absolute tolerance and a relative tolerance scaled by the largest singular value of its matrix.
- Parameters:
A (Tensor) – tensor of shape
(..., m, n)holding the matrices.atol (float, Tensor, optional) – absolute threshold applied to the singular values. Defaults to 0.
rtol (float, Tensor, optional) – relative threshold applied to the largest singular value. Defaults to
max(m, n)times the machine epsilon ofA’s dtype.hermitian (bool) – when True,
Ais treated as Hermitian and its rank is derived from eigenvalues instead of singular values.
- Returns:
integer tensor with the rank of each matrix, with the batch dimensions of
A.- Return type:
Help improve this page
Found an error, an unclear step, or a missing example?

