Skip to content

Commit c7a4624

Browse files
authored
Document that grad and j′vp return tuples. (#220)
* Document that grad and j′vp return tuples. Fixes #219. * bump patch version
1 parent be59589 commit c7a4624

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "FiniteDifferences"
22
uuid = "26cc04aa-876d-5657-8c51-4c34ba976000"
3-
version = "0.12.26"
3+
version = "0.12.27"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/grad.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ end
6666
j′vp(fdm, f, ȳ, x...)
6767
6868
Compute an adjoint with any types of arguments `x` for which [`to_vec`](@ref) is defined.
69+
70+
Return tuple of gradients, one for each argument.
6971
"""
7072
function j′vp(fdm, f, ȳ, x)
7173
x_vec, vec_to_x = to_vec(x)
@@ -84,5 +86,7 @@ end
8486
grad(fdm, f, xs...)
8587
8688
Compute the gradient of `f` for any `xs` for which [`to_vec`](@ref) is defined.
89+
90+
Return tuple of gradients, one for each argument.
8791
"""
8892
grad(fdm, f, xs...) = j′vp(fdm, f, 1, xs...) # `j′vp` with seed of 1

0 commit comments

Comments
 (0)