Skip to content

Commit

Permalink
fix the docstring of svd, according to the discussion in issue pytorc…
Browse files Browse the repository at this point in the history
  • Loading branch information
antocuni committed Oct 12, 2020
1 parent 1817211 commit 97662da
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion torch/_torch_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7150,7 +7150,18 @@ def merge_dicts(*dicts):
This function returns a namedtuple ``(U, S, V)`` which is the singular value
decomposition of a input real matrix or batches of real matrices :attr:`input` such that
:math:`input = U \times diag(S) \times V^T`.
:math:`input = U \times diag(S) \times V^H`, where :math:`V^H` is the conjugate transpose
of ``V``.
In Python, :math:`V^H` is computed by ``v.T.conj()``. Note that for
non-complex types, ``.conj()`` is a no-op and can be omittted. To summarize,
the original Tensor can be reconstructed by::
U @ diag(S) @ V.T.conj() # for real and complex numbers
U @ diag(S) @ V.T # only for real numbers
The dtype of ``U`` and ``V`` is the same as the ``input`` matrix. The dtype of
``S`` is always real numbers, even if ``input`` is complex.
If :attr:`some` is ``True`` (default), the method returns the reduced singular value decomposition
i.e., if the last two dimensions of :attr:`input` are ``m`` and ``n``, then the returned
Expand Down

0 comments on commit 97662da

Please sign in to comment.