Skip to content

Commit 644c581

Browse files
authored
Tweak API for update (#17)
* Tweak API for update * New dev version * remove -DEV * Allow tests to fail on nightly * Fix dep
1 parent 67879f0 commit 644c581

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ julia:
66
- 1.0
77
- 1.3
88
- nightly
9+
jobs:
10+
allow_failures:
11+
- julia: nightly
912

1013
notifications:
1114
email:
@@ -16,4 +19,4 @@ notifications:
1619
if: type = cron
1720
matrix:
1821
allow_failures:
19-
- julia: nightly
22+
- julia: nightly

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ChainRulesTestUtils"
22
uuid = "cdddcdb0-9152-4a09-a978-84456f9df70a"
3-
version = "0.1.3"
3+
version = "0.2.0"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
@@ -9,7 +9,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
99
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1010

1111
[compat]
12-
ChainRulesCore = "0.5, 0.6"
12+
ChainRulesCore = "0.7"
1313
FiniteDifferences = "0.7, 0.8, 0.9"
1414
julia = "1"
1515

src/ChainRulesTestUtils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function test_scalar(f, x; rtol=1e-9, atol=1e-9, fdm=_fdm, kwargs...)
6363
ensure_not_running_on_functor(f, "test_scalar")
6464

6565
r_res = rrule(f, x)
66-
f_res = frule(f, x, Zero(), 1)
66+
f_res = frule((Zero(), 1), f, x)
6767
@test r_res !== nothing # Check the rule was defined
6868
@test f_res !== nothing
6969
r_fx, prop_rule = r_res
@@ -111,7 +111,7 @@ end
111111
function frule_test(f, xẋs::Tuple{Any, Any}...; rtol=1e-9, atol=1e-9, fdm=_fdm, kwargs...)
112112
ensure_not_running_on_functor(f, "frule_test")
113113
xs, ẋs = collect(zip(xẋs...))
114-
Ω, dΩ_ad = frule(f, xs..., NO_FIELDS, ẋs...)
114+
Ω, dΩ_ad = frule((NO_FIELDS, ẋs...), f, xs...)
115115
@test f(xs...) == Ω
116116

117117
# Correctness testing via finite differencing.

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using Test
99
test_scalar(double, 2)
1010

1111
fst(x, y) = x
12-
ChainRulesCore.frule(::typeof(fst), x, y, _, dx, dy) = (x, dx)
12+
ChainRulesCore.frule((_, dx, dy), ::typeof(fst), x, y) = (x, dx)
1313

1414
function ChainRulesCore.rrule(::typeof(fst), x, y)
1515
function fst_pullback(Δx)

0 commit comments

Comments
 (0)