Skip to content

Commit 9b50626

Browse files
Merge pull request #82 from nickrobinson251/npr/fix-api-docs
Fix documentation to use ChainRulesCore
2 parents 3148fa4 + 96257e0 commit 9b50626

File tree

6 files changed

+33
-35
lines changed

6 files changed

+33
-35
lines changed

docs/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[deps]
2+
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
3+
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
24
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
35

46
[compat]
5-
Documenter = "~0.22"
7+
Documenter = "~0.23"

docs/make.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
using ChainRules
2+
using ChainRulesCore
23
using Documenter
34

4-
makedocs(modules=[ChainRules],
5-
sitename="ChainRules",
6-
authors="Jarrett Revels and other contributors",
7-
pages=["Introduction" => "index.md",
8-
"Getting Started" => "getting_started.md",
9-
"ChainRules API Documentation" => "api.md"])
5+
makedocs(
6+
modules=[ChainRules, ChainRulesCore],
7+
format=Documenter.HTML(prettyurls=false),
8+
sitename="ChainRules",
9+
authors="Jarrett Revels and other contributors",
10+
pages=[
11+
"Introduction" => "index.md",
12+
"Getting Started" => "getting_started.md",
13+
"API" => "api.md",
14+
],
15+
)
1016

1117
deploydocs(repo="github.com/JuliaDiff/ChainRules.jl.git")

docs/src/api.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
1-
# ChainRules API Documentation
1+
# API Documentation
22

3-
```@docs
4-
ChainRules.frule
5-
ChainRules.rrule
6-
ChainRules.AbstractRule
7-
ChainRules.Rule
8-
ChainRules.DNERule
9-
ChainRules.WirtingerRule
10-
ChainRules.accumulate
11-
ChainRules.accumulate!
12-
ChainRules.store!
13-
```
14-
15-
```@docs
16-
ChainRules.AbstractDifferential
17-
ChainRules.extern
18-
ChainRules.Casted
19-
ChainRules.Wirtinger
20-
ChainRules.Thunk
21-
ChainRules.Zero
22-
ChainRules.DNE
23-
ChainRules.One
3+
```@autodocs
4+
Modules = [ChainRulesCore]
245
```

docs/src/getting_started.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Getting Started
22

3+
[ChainRulesCore.jl](https://github.com/JuliaDiff/ChainRulesCore.jl) is a light-weight dependency for defining sensitivities for functions in your packages, without you needing to depend on ChainRules itself.
4+
It only depends on [Cassette.jl](https://github.com/jrevels/Cassette.jl) which is also light-weight and has no dependencies.
5+
6+
[ChainRules.jl](https://github.com/JuliaDiff/ChainRules.jl) provides the full functionality, including sensitivities for Base Julia and standard libraries.
7+
Sensitivities for some other packages, currently SpecialFunctions.jl and NaNMath.jl, will also be loaded if those packages are in your environment.
8+
In general, we recommend adding custom sensitivities to your own packages with ChainRulesCore.
9+
10+
## Defining Custom Sensitivities
11+
12+
TODO
13+
314
## Forward-Mode vs. Reverse-Mode Chain Rule Evaluation
415

516
TODO

docs/src/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
```@meta
2-
DocTestSetup = :(using ChainRules)
3-
CurrentModule = ChainRules
2+
DocTestSetup = :(using ChainRulesCore, ChainRules)
43
```
54

65
# ChainRules
76

8-
Hello! Welcome to ChainRules's documentation.
7+
[ChainRules.jl](https://github.com/JuliaDiff/ChainRules.jl) provides a variety of common utilities that can be used by downstream automatic differentiation (AD) tools to define and execute forward-, reverse-, and mixed-mode primitives.
98

10-
For an initial overview of ChainRules, please see the README. Otherwise, feel free to peruse available documentation via the sidebar.
9+
This package is a work-in-progress, as is the documentation. Contributions welcome!

src/ChainRules.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ module ChainRules
22
using Reexport
33
@reexport using ChainRulesCore
44
# Basically everything this package does is overloading these, so we make an exception
5-
# to the normal rule of only overload via `AbstractChainRules.rrule`.
5+
# to the normal rule of only overload via `ChainRulesCore.rrule`.
66
import ChainRulesCore: rrule, frule
77

88
# Deal with name clashes, by defining in this module which one we mean.
99
const accumulate = ChainRulesCore.accumulate
1010
const accumulate! = ChainRulesCore.accumulate!
1111

12-
1312
using LinearAlgebra
1413
using LinearAlgebra.BLAS
1514
using Requires

0 commit comments

Comments
 (0)