update torch.eig() doc (#10315)

Summary:
This fixes #9383

Update torch.eig() doc, the complex part is written based on https://scc.ustc.edu.cn/zlsc/sugon/intel/mkl/mkl_manual/GUID-16EB5901-5644-4DA6-A332-A052309010C4.htm
Pull Request resolved: https://github.com/pytorch/pytorch/pull/10315

Reviewed By: yf225

Differential Revision: D9200723

Pulled By: ailzhang

fbshipit-source-id: d2e186fd24defbc4fdea6c2cf3dc4f7e05e1d170
This commit is contained in:
Ailing Zhang 2018-08-08 06:41:11 -07:00 committed by Facebook Github Bot
parent 0d03219a42
commit 69760e2840

View File

@ -1277,7 +1277,8 @@ eig(a, eigenvectors=False, out=None) -> (Tensor, Tensor)
Computes the eigenvalues and eigenvectors of a real square matrix.
Args:
a (Tensor): the square matrix for which the eigenvalues and eigenvectors will be computed
a (Tensor): the square matrix of shape :math:`(n \times n)` for which the eigenvalues and eigenvectors
will be computed
eigenvectors (bool): ``True`` to compute both eigenvalues and eigenvectors;
otherwise, only eigenvalues will be computed
out (tuple, optional): the output tensors
@ -1285,8 +1286,17 @@ Args:
Returns:
(Tensor, Tensor): A tuple containing
- **e** (*Tensor*): the right eigenvalues of ``a``
- **v** (*Tensor*): the eigenvectors of ``a`` if ``eigenvectors`` is ``True``; otherwise an empty tensor
- **e** (*Tensor*): Shape :math:`(n \times 2)`. Each row is an eigenvalue of ``a``,
where the first element is the real part and the second element is the imaginary part.
The eigenvalues are not necessarily ordered.
- **v** (*Tensor*): If ``eigenvectors=False``, it's an empty tensor.
Otherwise, this tensor of shape :math:`(n \times n)` can be used to compute normalized (unit length)
eigenvectors of corresponding eigenvalues ``e`` as follows.
If the corresponding e[j] is a real number, column v[:, j] is the eigenvector corresponding to
eigenvalue e[j].
If the corresponding e[j] and e[j + 1] eigenvalues form a complex conjugate pair, then the true eigenvectors
can be computed as
:math:`eigenvector[j] = v[:, j] + i * v[:, j + 1], eigenvector[j + 1] = v[:, j] - i * v[:, j + 1]`.
""")
add_docstr(torch.einsum,