Skip to content

Commit 32d262d

Browse files
oxinaboxgiordano
andauthored
use new ChainRulesTestUtils (#300)
* use new ChainRulesTestUtils * Disable PkgServer on Travis Co-authored-by: Mosè Giordano <[email protected]>
1 parent 0362edf commit 32d262d

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ matrix:
1111
notifications:
1212
email: false
1313

14+
env:
15+
# Disable PkgServer
16+
- JULIA_PKG_SERVER=""
17+
1418
branches:
1519
only:
1620
- master

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ OpenSpecFun_jll = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
88

99
[compat]
1010
ChainRulesCore = "0.9"
11-
ChainRulesTestUtils = "0.5.10, 0.6"
11+
ChainRulesTestUtils = "0.6.3"
1212
OpenSpecFun_jll = "0.5"
1313
julia = "1.3"
1414

test/chainrules.jl

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,11 @@
4141
for _x in test_points, _y in test_points
4242
# ensure all complex if any complex for FiniteDifferences
4343
x, y = promote(_x, _y)
44-
T = typeof(x)
44+
test_frule(beta, x, y)
45+
test_rrule(beta, x, y)
4546

46-
Δx, x̄ = randn(T, 2)
47-
Δy, ȳ = randn(T, 2)
48-
Δz = randn(T)
49-
50-
frule_test(beta, (x, Δx), (y, Δy))
51-
rrule_test(beta, Δz, (x, x̄), (y, ȳ))
52-
53-
frule_test(logbeta, (x, Δx), (y, Δy))
54-
rrule_test(logbeta, Δz, (x, x̄), (y, ȳ))
47+
test_frule(logbeta, x, y)
48+
test_rrule(logbeta, x, y)
5549
end
5650
end
5751

@@ -62,12 +56,8 @@
6256
test_scalar(loggamma, x)
6357

6458
isreal(x) || continue
65-
66-
Δx, x̄ = randn(2)
67-
Δz = (randn(), randn())
68-
69-
frule_test(logabsgamma, (x, Δx))
70-
rrule_test(logabsgamma, Δz, (x, x̄))
59+
test_frule(logabsgamma, x)
60+
test_rrule(logabsgamma, x; output_tangent=(randn(), randn()))
7161
end
7262
end
7363
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file contains code that was formerly a part of Julia. License is MIT: http://julialang.org/license
22

33
using SpecialFunctions
4+
using ChainRulesCore
45
using ChainRulesTestUtils
56
using Random
67
using Test

0 commit comments

Comments
 (0)