Skip to content

Commit 6c4530f

Browse files
improve docstring
1 parent 6322505 commit 6c4530f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/layers/basic.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,22 @@ returns the dot product `x_i ⋅ xj` on each edge.
163163
# Usage
164164
165165
```juliarepl
166+
julia> g = rand_graph(5, 6)
167+
GNNGraph:
168+
num_nodes = 5
169+
num_edges = 6
166170
171+
julia> dotdec = DotDecoder()
172+
DotDecoder()
173+
174+
julia> dotdec(g, rand(2, 5))
175+
1×6 Matrix{Float64}:
176+
0.345098 0.458305 0.106353 0.345098 0.458305 0.106353
167177
```
168178
"""
169179
struct DotDecoder <: GNNLayer end
170180

171181
function (::DotDecoder)(g, x)
182+
check_num_nodes(g, x)
172183
apply_edges(xi_dot_xj, g, xi=x, xj=x)
173184
end

0 commit comments

Comments
 (0)