You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+14-9Lines changed: 14 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
```@meta
2
-
DocTestFilters = r"[0-9\.]+s"
2
+
DocTestFilters = [r"[0-9\.]+s",r"isapprox\(.*\)"]
3
3
```
4
4
# ChainRulesTestUtils
5
5
@@ -41,12 +41,12 @@ end
41
41
# output
42
42
43
43
```
44
-
and `rrule`
44
+
and `rrule` which contains a mistake in the first cotangent
45
45
```jldoctest ex
46
46
function ChainRulesCore.rrule(::typeof(two2three), x1, x2)
47
47
y = two2three(x1, x2)
48
48
function two2three_pullback(Ȳ)
49
-
return (NoTangent(), 2.0*Ȳ[2], 3.0*Ȳ[3])
49
+
return (NoTangent(), 2.1*Ȳ[2], 3.0*Ȳ[3])
50
50
end
51
51
return y, two2three_pullback
52
52
end
@@ -69,22 +69,27 @@ julia> using ChainRulesTestUtils;
69
69
70
70
julia> test_frule(two2three, 3.33, -7.77);
71
71
Test Summary: | Pass Total Time
72
-
test_frule: two2three on Float64,Float64 | 6 6 2.4s
72
+
test_frule: two2three on Float64,Float64 | 6 6 2.7s
73
73
74
74
```
75
75
76
76
### Testing the `rrule`
77
77
78
-
[`test_rrule`](@ref) takes in the function `f`, and primal inputsr`x`.
78
+
[`test_rrule`](@ref) takes in the function `f`, and primal inputs`x`.
79
79
The call will test the `rrule` for function `f` at the point `x`, and similarly to `frule` some rules should be tested at multiple points in the domain.
80
80
81
81
```jldoctest ex
82
82
julia> test_rrule(two2three, 3.33, -7.77);
83
-
Test Summary: | Pass Total Time
84
-
test_rrule: two2three on Float64,Float64 | 10 10 0.9s
85
-
83
+
test_rrule: two2three on Float64,Float64: Test Failed at /home/lior/.julia/dev/ChainRulesTestUtils/src/check_result.jl:24
The output of the test indicates to us the cause of the failure under "Problem:" with the expected (`rrule` derived) and actual finite difference results.
91
+
The Problem lies with the cotangent corresponding to input 2 of `rrule`, which is the first cotangent as expected.
92
+
88
93
## Scalar example
89
94
90
95
For functions with a single argument and a single output, such as e.g. ReLU,
0 commit comments