Skip to content

Commit

Permalink
Clarify that grad requires arguments to be differentiated to be of …
Browse files Browse the repository at this point in the history
…inexact type. (#2712)
  • Loading branch information
hawkinsp authored Apr 28, 2020
1 parent ca4e396 commit 0dbbc27
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jax/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ def grad(fun: Callable, argnums: Union[int, Sequence[int]] = 0,
Args:
fun: Function to be differentiated. Its arguments at positions specified by
``argnums`` should be arrays, scalars, or standard Python containers. It
``argnums`` should be arrays, scalars, or standard Python containers.
Argument arrays in the positions specified by ``argnums`` must be of
inexact (i.e., floating-point or complex) type. It
should return a scalar (which includes arrays with shape ``()`` but not
arrays with shape ``(1,)`` etc.)
argnums: Optional, integer or sequence of integers. Specifies which
Expand Down

0 comments on commit 0dbbc27

Please sign in to comment.