# tensorplay.linalg.matrix_rank Source: https://www.tensorplay.cn/docs/generated/tensorplay.linalg.matrix_rank.html ```python tensorplay.linalg.matrix_rank(A, *, atol=None, rtol=None, hermitian=False) ``` 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](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)) – tensor of shape (..., m, n) holding the matrices. - atol ([float](https://docs.python.org/3/builtins/functions.html#float), [Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor), optional) – absolute threshold applied to the singular values. Defaults to 0. - rtol ([float](https://docs.python.org/3/builtins/functions.html#float), [Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor), optional) – relative threshold applied to the largest singular value. Defaults to max(m, n) times the machine epsilon of A’s dtype. - hermitian ([bool](https://docs.python.org/3/builtins/functions.html#bool)) – when True, A is 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: [Tensor](/docs/generated/tensorplay.Tensor.html#tensorplay.Tensor)