Skip to content

Commit 3f470cc

Browse files
author
0x45f
committed
update doc commets
1 parent a5eb6f3 commit 3f470cc

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

python/paddle/tensor/linalg.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -787,25 +787,22 @@ def cholesky(x, upper=False, name=None):
787787

788788
def matrix_rank(x, tol=None, hermitian=False, name=None):
789789
r"""
790-
Computes the numerical rank of a matrix.
790+
Computes the rank of a matrix.
791791
792-
The matrix rank is computed as the number of singular values (or eigenvalues in absolute value when hermitian= True) that
793-
are greater than the specified tol threshold.
794-
795-
Supports input of float, double dtypes. It also supports batches of matrices, and if x is a batch of matrices then the output
796-
has the same batch dimensions.
797-
798-
If hermitian= True, x is assumed to be Hermitian, but this is not checked internally. Instead, just the lower triangular
799-
part of the matrix is used in the computations.
800-
801-
If tol is not specified and x is a matrix of dimensions (m, n), the tolerance is set to be tol=sigma * max(m,n) * eps where
802-
sigma is the largest singular value (or eigenvalue in absolute value when hermitian= True), and eps is the epsilon value for the
803-
dtype of x. If x is a batch of matrices, tol is computed this way for every element of the batch.
792+
The rank of a matrix is the number of singular values that are greater than the specified tol threshold when hermitian=False,
793+
or the number of eigenvalues in absolute value that are greater than the specified tol threshold when hermitian=True.
804794
805795
Args:
806-
x (Tensor): tensor of shape [*, m, n] where * is zero or more batch dimensions.
807-
tol (float,Tensor,optional): the tolerance value. See above for the value it takes when None. Default: None.
808-
hermitian (bool,optional): indicates whether x is Hermitian. Default: False.
796+
x (Tensor): The input tensor.
797+
Its shape should be [..., m, n], where ... is zero or more batch dimensions. If x is a batch of matrices then the output
798+
has the same batch dimensions. The data type of x should be float32 or float64.
799+
tol (float,Tensor,optional): the tolerance value. Default: None.
800+
If tol is not specified, and sigma is the largest singular value (or eigenvalue in absolute value), and eps is the
801+
epsilon value for the dtype of x, then tol is computed with formula tol=sigma * max(m,n) * eps. Note that if x is
802+
a batch of matrices, tol is computed this way for every batch.
803+
hermitian (bool,optional): indicates whether x is Hermitian. Default: False.
804+
When hermitian=True, x is assumed to be Hermitian, but x is not checked inside the function. Instead, We just use the
805+
lower triangular of the matrix to compute.
809806
name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
810807
811808
Returns:

0 commit comments

Comments
 (0)