Skip to content

Commit 68fc041

Browse files
committed
update Documentor and get it to fix
1 parent e5990aa commit 68fc041

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

docs/Manifest.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ version = "0.10.5"
1919
deps = ["ChainRulesCore", "Compat", "FiniteDifferences", "LinearAlgebra", "Random", "Test"]
2020
path = ".."
2121
uuid = "cdddcdb0-9152-4a09-a978-84456f9df70a"
22-
version = "0.7.10"
22+
version = "0.7.12"
2323

2424
[[Compat]]
2525
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
@@ -47,9 +47,9 @@ version = "0.8.5"
4747

4848
[[Documenter]]
4949
deps = ["Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
50-
git-tree-sha1 = "3ebb967819b284dc1e3c0422229b58a40a255649"
50+
git-tree-sha1 = "5acbebf1be22db43589bc5aa1bb5fcc378b17780"
5151
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
52-
version = "0.26.3"
52+
version = "0.27.0"
5353

5454
[[Downloads]]
5555
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
@@ -62,10 +62,10 @@ uuid = "26cc04aa-876d-5657-8c51-4c34ba976000"
6262
version = "0.12.13"
6363

6464
[[IOCapture]]
65-
deps = ["Logging"]
66-
git-tree-sha1 = "377252859f740c217b936cebcd918a44f9b53b59"
65+
deps = ["Logging", "Random"]
66+
git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
6767
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
68-
version = "0.1.1"
68+
version = "0.2.2"
6969

7070
[[InteractiveUtils]]
7171
deps = ["Markdown"]

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
44
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
55

66
[compat]
7-
Documenter = "0.26"
7+
Documenter = "0.27"
88
julia = "1"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ makedocs(;
1212
],
1313
strict=true,
1414
checkdocs=:exports,
15-
)
15+
)
1616

1717
const repo = "github.com/JuliaDiff/ChainRulesTestUtils.jl.git"
1818
deploydocs(; repo=repo, push_preview=true)

docs/src/index.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For information about ChainRules, including how to write rules, refer to the gen
1212
## Canonical example
1313

1414
Let's suppose a custom transformation has been defined
15-
```jldoctest ex; output = false
15+
```jldoctest ex
1616
function two2three(x1::Float64, x2::Float64)
1717
return 1.0, 2.0*x1, 3.0*x2
1818
end
@@ -21,7 +21,7 @@ end
2121
two2three (generic function with 1 method)
2222
```
2323
along with the `frule`
24-
```jldoctest ex; output = false
24+
```jldoctest ex
2525
using ChainRulesCore
2626
2727
function ChainRulesCore.frule((Δf, Δx1, Δx2), ::typeof(two2three), x1, x2)
@@ -33,7 +33,7 @@ end
3333
3434
```
3535
and `rrule`
36-
```jldoctest ex; output = false
36+
```jldoctest ex
3737
function ChainRulesCore.rrule(::typeof(two2three), x1, x2)
3838
y = two2three(x1, x2)
3939
function two2three_pullback(Ȳ)
@@ -55,10 +55,12 @@ They can be used for any type and number of inputs and outputs.
5555
The call will test the `frule` for function `f` at the point `x` in the domain.
5656
Keep this in mind when testing discontinuous rules for functions like [ReLU](https://en.wikipedia.org/wiki/Rectifier_(neural_networks)), which should ideally be tested at both `x` being above and below zero.
5757

58-
```jldoctest ex; output = false
58+
```jldoctest ex
5959
julia> using ChainRulesTestUtils;
6060
6161
julia> test_frule(two2three, 3.33, -7.77);
62+
Test Summary: | Pass Total
63+
test_frule: two2three on Float64,Float64 | 6 6
6264
6365
```
6466

@@ -67,15 +69,17 @@ julia> test_frule(two2three, 3.33, -7.77);
6769
[`test_rrule`](@ref) takes in the function `f`, and primal inputsr `x`.
6870
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.
6971

70-
```jldoctest ex; output = false
72+
```jldoctest ex
7173
julia> test_rrule(two2three, 3.33, -7.77);
74+
Test Summary: | Pass Total
75+
test_rrule: two2three on Float64,Float64 | 8 8
7276
7377
```
7478

7579
## Scalar example
7680

7781
For functions with a single argument and a single output, such as e.g. ReLU,
78-
```jldoctest ex; output = false
82+
```jldoctest ex
7983
function relu(x::Real)
8084
return max(0, x)
8185
end
@@ -84,7 +88,7 @@ end
8488
relu (generic function with 1 method)
8589
```
8690
with the `frule` and `rrule` defined with the help of `@scalar_rule` macro
87-
```jldoctest ex; output = false
91+
```jldoctest ex
8892
@scalar_rule relu(x::Real) x <= 0 ? zero(x) : one(x)
8993
9094
# output
@@ -93,11 +97,15 @@ with the `frule` and `rrule` defined with the help of `@scalar_rule` macro
9397

9498
`test_scalar` function is provided to test both the `frule` and the `rrule` with a single
9599
call.
96-
```jldoctest ex; output = false
100+
```jldoctest ex
97101
julia> test_scalar(relu, 0.5);
102+
Test Summary: | Pass Total
103+
test_scalar: relu at 0.5 | 10 10
98104
99105
100106
julia> test_scalar(relu, -0.5);
107+
Test Summary: | Pass Total
108+
test_scalar: relu at -0.5 | 10 10
101109
102110
```
103111

0 commit comments

Comments
 (0)