Skip to content

Commit

Permalink
Update to FiniteDifferences 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrobinson251 committed Mar 1, 2020
1 parent 71a9789 commit 1935f28
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
12 changes: 7 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ChainRules"
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
version = "0.4.0"
version = "0.4.1"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand All @@ -10,20 +10,22 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
ChainRulesCore = "0.7.0"
ChainRulesTestUtils = "0.2"
FiniteDifferences = "0.7"
ChainRulesCore = "0.7"
ChainRulesTestUtils = "0.2.1"
Compat = "3"
FiniteDifferences = "0.9"
Reexport = "0.2"
Requires = "0.5.2, 1"
julia = "1"

[extras]
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["ChainRulesTestUtils", "FiniteDifferences", "NaNMath", "Random", "SpecialFunctions", "Test"]
test = ["ChainRulesTestUtils", "Compat", "FiniteDifferences", "NaNMath", "Random", "SpecialFunctions", "Test"]
4 changes: 2 additions & 2 deletions test/rulesets/Base/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
y, pullback = rrule(mapreduce, abs2, +, X; dims=2)
= randn(rng, size(y))
(_, _, _, x̄_ad) = pullback(ȳ)
x̄_fd = j′vp(central_fdm(5, 1), x->mapreduce(abs2, +, x; dims=2), ȳ, X)
x̄_fd = only(j′vp(central_fdm(5, 1), x->mapreduce(abs2, +, x; dims=2), ȳ, X))
@test x̄_ad x̄_fd atol=1e-9 rtol=1e-9
end
@testset "$f" for f in (mapfoldl, mapfoldr)
Expand Down Expand Up @@ -61,7 +61,7 @@
y, pullback = rrule(sum, X; dims=2)
= randn(rng, size(y))
_, x̄_ad = pullback(ȳ)
x̄_fd = j′vp(central_fdm(5, 1), x->sum(x, dims=2), ȳ, X)
x̄_fd = only(j′vp(central_fdm(5, 1), x->sum(x, dims=2), ȳ, X))
@test x̄_ad x̄_fd atol=1e-9 rtol=1e-9
end
end # sum
Expand Down
2 changes: 1 addition & 1 deletion test/rulesets/LinearAlgebra/factorization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using ChainRules: level2partition, level3partition, chol_blocked_rev, chol_unblo
dself2, dX = dX_pullback(ΔF)
@test dself2 === NO_FIELDS
X̄_ad = unthunk(dX)
X̄_fd = j′vp(central_fdm(5, 1), X->getproperty(svd(X), p), Ȳ, X)
X̄_fd = only(j′vp(central_fdm(5, 1), X->getproperty(svd(X), p), Ȳ, X))
@test all(isapprox.(X̄_ad, X̄_fd; rtol=1e-6, atol=1e-6))
end
@testset "Vt" begin
Expand Down
2 changes: 1 addition & 1 deletion test/rulesets/Statistics/statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
= randn(rng, size(y))
_, dX = mean_pullback(ȳ)
X̄_ad = extern(dX)
X̄_fd = j′vp(_fdm, x->mean(x, dims=1), ȳ, X)
X̄_fd = only(j′vp(_fdm, x->mean(x, dims=1), ȳ, X))
@test X̄_ad X̄_fd rtol=1e-9 atol=1e-9
end
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ using ChainRules
using ChainRulesCore
using ChainRulesTestUtils
using ChainRulesTestUtils: _fdm
using Compat: only
using FiniteDifferences
using LinearAlgebra
using LinearAlgebra.BLAS
Expand Down

0 comments on commit 1935f28

Please sign in to comment.