Skip to content

Commit

Permalink
docs: improve torch.matrix_exp() (pytorch#55626)
Browse files Browse the repository at this point in the history
Summary:
Add a signature and make the mathematical expression related to the signature

Fixes pytorch#55599

Pull Request resolved: pytorch#55626

Reviewed By: ngimel

Differential Revision: D27699518

Pulled By: mruberry

fbshipit-source-id: e61d76e99eb8fc36114c1c2ee90990740d78beea
  • Loading branch information
neal2018 authored and facebook-github-bot committed Apr 11, 2021
1 parent 93bf0ae commit a3c062d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions torch/_torch_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5000,13 +5000,14 @@ def merge_dicts(*dicts):
Alias for :func:`torch.linalg.matrix_power`
""".format(**common_args))

add_docstr(torch.matrix_exp,
r"""
Returns the matrix exponential. Supports batched input.
For a matrix ``A``, the matrix exponential is defined as
add_docstr(torch.matrix_exp, r"""
matrix_exp(input) -> Tensor
Computes the matrix exponential of a square matrix or of each square matrix in a batch.
For a matrix :attr:`input`, the matrix exponential is defined as
.. math::
\mathrm{e}^A = \sum_{k=0}^\infty A^k / k!
\mathrm{e}^\text{input} = \sum_{k=0}^\infty \text{input}^k / k!
""" + r"""
The implementation is based on:
Expand Down

0 comments on commit a3c062d

Please sign in to comment.