Skip to content

Commit 53d1b63

Browse files
ssnlsoumith
authored andcommitted
improve svd doc (#4155)
1 parent 9e18db9 commit 53d1b63

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

torch/_torch_docs.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4294,23 +4294,22 @@
42944294
`U, S, V = torch.svd(A)` returns the singular value decomposition of a
42954295
real matrix `A` of size `(n x m)` such that :math:`A = USV^T`.
42964296
4297-
`U` is of shape :math:`(n \times \min(n, m))`.
4297+
`U` is of shape :math:`(n \times n)`.
42984298
4299-
`S` is a diagonal matrix of shape :math:`(\min(n, m) \times \min(n, m))`,
4300-
represented as a vector of size :math:`\min(n, m)` containing the diagonal
4301-
entries.
4299+
`S` is a diagonal matrix of shape :math:`(n \times m)`, represented as a vector
4300+
of size :math:`\min(n, m)` containing the diagonal entries.
43024301
4303-
`V` is of shape :math:`(m \times \min(n, m))`.
4302+
`V` is of shape :math:`(m \times m)`.
43044303
4305-
:attr:`some` represents the number of singular values to be computed.
4306-
If `some=True`, it computes some and `some=False` computes all.
4304+
If :attr:`some` is ``True`` (default), the returned `U` and `V` matrices will
4305+
contain only :math:`min(n, m)` orthonormal columns.
43074306
43084307
.. note:: Irrespective of the original strides, the returned matrix `U`
43094308
will be transposed, i.e. with strides `(1, n)` instead of `(n, 1)`.
43104309
43114310
Args:
43124311
input (Tensor): the input 2-D tensor
4313-
some (bool, optional): controls the number of singular values to be computed
4312+
some (bool, optional): controls the shape of returned `U` and `V`
43144313
out (tuple, optional): the output tuple of tensors
43154314
43164315
Example::

0 commit comments

Comments
 (0)