Skip to content

Commit 1c798dd

Browse files
Merge pull request #24 from CarloLucibello/cl/data2
show for GNNGraph
2 parents fe61fee + 0c1733d commit 1c798dd

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1515
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1616
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
1717
NNlibCUDA = "a00861dc-f156-4864-bf3c-e6376f28a68d"
18-
PrettyPrint = "8162dcfd-2161-5ef2-ae6c-7681170c5f98"
19-
PrettyPrinting = "54e16d92-306c-5ea0-a30b-337be88ac337"
2018
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
2119
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2220
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using Documenter
44
DocMeta.setdocmeta!(GraphNeuralNetworks, :DocTestSetup, :(using GraphNeuralNetworks); recursive=true)
55

66
makedocs(;
7-
modules=[GraphNeuralNetworks, NNlib],
7+
modules=[GraphNeuralNetworks],
88
sitename = "GraphNeuralNetworks.jl",
99
pages = ["Home" => "index.md",
1010
"GNNGraph" => "gnngraph.md",

examples/graph_classification_tudataset.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,8 @@ function train(; kws...)
7373

7474
gfull = getdataset()
7575

76-
@info "MUTAG DATASET
77-
num_nodes: $(gfull.num_nodes)
78-
num_edges: $(gfull.num_edges)
79-
num_graphs: $(gfull.num_graphs)"
80-
76+
@info gfull
77+
8178
perm = randperm(gfull.num_graphs)
8279
gtrain = getobs(gfull, perm[1:NUM_TRAIN])
8380
gtest = getobs(gfull, perm[NUM_TRAIN+1:end])

src/gnngraph.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,26 @@ function GNNGraph(g::GNNGraph; ndata=g.ndata, edata=g.edata, gdata=g.gdata)
166166
ndata, edata, gdata)
167167
end
168168

169+
function Base.show(io::IO, g::GNNGraph)
170+
println(io, "GNNGraph:
171+
num_nodes = $(g.num_nodes)
172+
num_edges = $(g.num_edges)
173+
num_graphs = $(g.num_graphs)
174+
# feature name => array size")
175+
println(io, " ndata:")
176+
for k in keys(g.ndata)
177+
println(io, " $k => $(size(g.ndata[k]))")
178+
end
179+
println(io, " edata:")
180+
for k in keys(g.edata)
181+
println(io, " $k => $(size(g.edata[k]))")
182+
end
183+
println(io, " gdata:")
184+
for k in keys(g.gdata)
185+
println(io, " $k => $(size(g.gdata[k]))")
186+
end
187+
end
188+
169189
"""
170190
edge_index(g::GNNGraph)
171191

0 commit comments

Comments
 (0)