Skip to content

Commit

Permalink
Add note about autodiff::seed() to the docs (#1597)
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 authored Jun 28, 2024
1 parent 01c244a commit ed417bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sphinx_docs/source/autodiff.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ We can then use ``autodiff::val(result)`` or
x. The ``static_cast`` version has the advantage of working on normal
numbers as well.

``autodiff::seed(x)`` sets the derivative term of ``x`` to 1 (it is equivalent
to ``x.grad = 1.0``), which effectively tells the code that
:math:`\frac{\partial x}{\partial x} = 1`. This propagates through any
operations that ``f(x)`` does, and we end up with :math:`\frac{\partial
f(x)}{\partial x}` in the derivative term of ``result``.


Derivatives of multi-variable functions
=======================================
Expand Down

0 comments on commit ed417bc

Please sign in to comment.