Skip to content

Commit ed56978

Browse files
fix doctests
1 parent 86fad04 commit ed56978

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

GNNLux/docs/make.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ using GNNLux
1212
using Lux, GNNGraphs, GNNlib, Graphs
1313
using DocumenterInterLinks
1414

15+
ENV["DATADEPS_ALWAYS_ACCEPT"] = true # for MLDatasets
16+
17+
DocMeta.setdocmeta!(GNNGraphs, :DocTestSetup, :(using GNNGraphs, MLUtils); recursive = true)
18+
DocMeta.setdocmeta!(GNNlib, :DocTestSetup, :(using GNNlib); recursive = true)
1519
DocMeta.setdocmeta!(GNNLux, :DocTestSetup, :(using GNNLux); recursive = true)
1620

1721
mathengine = MathJax3(Dict(:loader => Dict("load" => ["[tex]/require", "[tex]/mathtools"]),

GNNLux/docs/src/api/pool.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ CollapsedDocStrings = true
55

66
# Pooling Layers
77

8-
## Index
9-
10-
```@index
11-
Order = [:type, :function]
12-
Pages = ["pool.md"]
13-
```
14-
158
```@autodocs
169
Modules = [GNNLux]
1710
Pages = ["layers/pool.jl"]

GNNLux/src/layers/basic.jl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ julia> using Lux, GNNLux, Random
3131
3232
julia> rng = Random.default_rng();
3333
34-
julia> m = GNNChain(GCNConv(2=>5),
35-
x -> relu.(x),
36-
Dense(5=>4))
34+
julia> m = GNNChain(GCNConv(2 => 5, relu), Dense(5 => 4))
35+
GNNChain(
36+
layers = NamedTuple(
37+
layer_1 = GCNConv(2 => 5, relu), # 15 parameters
38+
layer_2 = Dense(5 => 4), # 24 parameters
39+
),
40+
) # Total: 39 parameters,
41+
# plus 0 states.
3742
3843
julia> x = randn(rng, Float32, 2, 3);
3944
@@ -44,8 +49,10 @@ GNNGraph:
4449
4550
julia> ps, st = LuxCore.setup(rng, m);
4651
47-
julia> m(g, x, ps, st) # First entry is the output, second entry is the state of the model
48-
(Float32[-0.15594329 -0.15594329 -0.15594329; 0.93431795 0.93431795 0.93431795; 0.27568763 0.27568763 0.27568763; 0.12568939 0.12568939 0.12568939], (layer_1 = NamedTuple(), layer_2 = NamedTuple(), layer_3 = NamedTuple()))
52+
julia> y, st = m(g, x, ps, st); # First entry is the output, second entry is the state of the model
53+
54+
julia> size(y)
55+
(4, 3)
4956
```
5057
"""
5158
@concrete struct GNNChain <: GNNContainerLayer{(:layers,)}

GNNlib/docs/make.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ using GNNGraphs
1212
import Graphs
1313
using DocumenterInterLinks
1414

15+
ENV["DATADEPS_ALWAYS_ACCEPT"] = true # for MLDatasets
16+
DocMeta.setdocmeta!(GNNGraphs, :DocTestSetup, :(using GNNGraphs, MLUtils); recursive = true)
17+
DocMeta.setdocmeta!(GNNlib, :DocTestSetup, :(using GNNlib); recursive = true)
18+
1519
assets=[]
1620
prettyurls = get(ENV, "CI", nothing) == "true"
1721
mathengine = MathJax3()

GraphNeuralNetworks/docs/src/api/pool.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ CollapsedDocStrings = true
55

66
# Pooling Layers
77

8-
## Index
9-
10-
```@index
11-
Order = [:type, :function]
12-
Pages = ["pool.md"]
13-
```
14-
158
```@autodocs
169
Modules = [GraphNeuralNetworks]
1710
Pages = ["layers/pool.jl"]

0 commit comments

Comments
 (0)