Skip to content

Commit 1022f1c

Browse files
Merge #1654
1654: add Functors docs r=DhairyaLGandhi a=DhairyaLGandhi Close #1653 Co-authored-by: Dhairya Gandhi <dhairya@juliacomputing.com>
2 parents 8162b8a + 77f7271 commit 1022f1c

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
34
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
45

56
[compat]

docs/make.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using Documenter, Flux, NNlib
1+
using Documenter, Flux, NNlib, Functors
22

3-
DocMeta.setdocmeta!(Flux, :DocTestSetup, :(using Flux); recursive=true)
4-
makedocs(modules=[Flux, NNlib],
3+
DocMeta.setdocmeta!(Flux, :DocTestSetup, :(using Flux); recursive = true)
4+
makedocs(modules = [Flux, NNlib, Functors],
55
doctest = VERSION == v"1.5",
66
sitename = "Flux",
77
pages = ["Home" => "index.md",
@@ -13,7 +13,8 @@ makedocs(modules=[Flux, NNlib],
1313
"Loss Functions" => "models/losses.md",
1414
"Regularisation" => "models/regularisation.md",
1515
"Advanced Model Building" => "models/advanced.md",
16-
"NNlib" => "models/nnlib.md"],
16+
"NNlib" => "models/nnlib.md",
17+
"Functors" => "models/functors.md"],
1718
"Handling Data" =>
1819
["One-Hot Encoding" => "data/onehot.md",
1920
"DataLoader" => "data/dataloader.md"],

docs/src/models/functors.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Functors.jl
2+
3+
Flux makes use of the Functors.jl to represent many of the core functionalities it provides.
4+
5+
Functors.jl is a collection of tools designed to represent a [functor](https://en.wikipedia.org/wiki/Functor_(functional_programming)). Flux makes use of it to treat certain structs as functors. Notable examples include the layers that Flux defines.
6+
7+
```@docs
8+
Functors.isleaf
9+
Functors.children
10+
Functors.fcollect
11+
Functors.functor
12+
Functors.fmap
13+
```

0 commit comments

Comments
 (0)