Skip to content

Commit fc8ad6f

Browse files
ssnlsoumith
authored andcommitted
improve svd doc (#4155)
1 parent dde10e1 commit fc8ad6f

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
@@ -4295,16 +4295,15 @@
42954295
`U, S, V = torch.svd(A)` returns the singular value decomposition of a
42964296
real matrix `A` of size `(n x m)` such that :math:`A = USV^T`.
42974297
4298-
`U` is of shape :math:`(n \times \min(n, m))`.
4298+
`U` is of shape :math:`(n \times n)`.
42994299
4300-
`S` is a diagonal matrix of shape :math:`(\min(n, m) \times \min(n, m))`,
4301-
represented as a vector of size :math:`\min(n, m)` containing the diagonal
4302-
entries.
4300+
`S` is a diagonal matrix of shape :math:`(n \times m)`, represented as a vector
4301+
of size :math:`\min(n, m)` containing the diagonal entries.
43034302
4304-
`V` is of shape :math:`(m \times \min(n, m))`.
4303+
`V` is of shape :math:`(m \times m)`.
43054304
4306-
:attr:`some` represents the number of singular values to be computed.
4307-
If `some=True`, it computes some and `some=False` computes all.
4305+
If :attr:`some` is ``True`` (default), the returned `U` and `V` matrices will
4306+
contain only :math:`min(n, m)` orthonormal columns.
43084307
43094308
.. note:: Irrespective of the original strides, the returned matrix `U`
43104309
will be transposed, i.e. with strides `(1, n)` instead of `(n, 1)`.
@@ -4321,7 +4320,7 @@
43214320
43224321
Args:
43234322
input (Tensor): the input 2-D tensor
4324-
some (bool, optional): controls the number of singular values to be computed
4323+
some (bool, optional): controls the shape of returned `U` and `V`
43254324
out (tuple, optional): the output tuple of tensors
43264325
43274326
Example::

0 commit comments

Comments
 (0)