Skip to content

Commit

Permalink
Document that grad and j′vp return tuples. (#220)
Browse files Browse the repository at this point in the history
* Document that grad and j′vp return tuples.

Fixes #219.

* bump patch version
  • Loading branch information
tpapp authored May 25, 2023
1 parent be59589 commit c7a4624
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "FiniteDifferences"
uuid = "26cc04aa-876d-5657-8c51-4c34ba976000"
version = "0.12.26"
version = "0.12.27"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
4 changes: 4 additions & 0 deletions src/grad.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ end
j′vp(fdm, f, ȳ, x...)
Compute an adjoint with any types of arguments `x` for which [`to_vec`](@ref) is defined.
Return tuple of gradients, one for each argument.
"""
function j′vp(fdm, f, ȳ, x)
x_vec, vec_to_x = to_vec(x)
Expand All @@ -84,5 +86,7 @@ end
grad(fdm, f, xs...)
Compute the gradient of `f` for any `xs` for which [`to_vec`](@ref) is defined.
Return tuple of gradients, one for each argument.
"""
grad(fdm, f, xs...) = j′vp(fdm, f, 1, xs...) # `j′vp` with seed of 1

2 comments on commit c7a4624

@willtebbutt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/84208

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.12.27 -m "<description of version>" c7a4624092d90b6d49d5701967982226231d4478
git push origin v0.12.27

Please sign in to comment.