Skip to content

Commit

Permalink
added FiniteDifferences
Browse files Browse the repository at this point in the history
  • Loading branch information
ThummeTo committed Sep 12, 2023
1 parent 943d27c commit 9fa4199
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ using Test
using ChainRules, ChainRulesCore, ForwardDiff
using LinearAlgebra
import NamedTupleTools: ntfromstruct, structfromnt
import FiniteDifferences

#
# Copyright (c) 2022 The contributors
Expand Down Expand Up @@ -173,7 +174,7 @@ SOFTWARE.
fexp = x -> sum(LinearAlgebra.exp!(copy(x)))
X = rand(4, 4)
g = ForwardDiff.gradient(fexp, X)
g2 = FiniteDifferences.grad(central_fdm(5, 1), fexp, X)[1]
g2 = FiniteDifferences.grad(FiniteDifferences.central_fdm(5, 1), fexp, X)[1]
@test norm(g-g2) < 1e-4
end
@testset "kwargs" begin
Expand Down

0 comments on commit 9fa4199

Please sign in to comment.