Skip to content

Commit b7b773e

Browse files
fix gated graph conv
1 parent 83c1c31 commit b7b773e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

GNNLux/src/layers/conv.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ LuxCore.parameterlength(l::GatedGraphConv) = parameterlength(l.gru) + l.dims^2*l
12611261

12621262
function (l::GatedGraphConv)(g, x, ps, st)
12631263
gru = StatefulLuxLayer{true}(l.gru, ps.gru, _getstate(st, :gru))
1264-
fgru = (h, x) -> gru((x, (h,))) # make the forward compatible with Flux.GRUCell style
1264+
fgru = (x, h) -> gru((x, (h,)))[1] # make the forward compatible with Flux.GRUCell style
12651265
m = (; gru=fgru, ps.weight, l.num_layers, l.aggr, l.dims)
12661266
return GNNlib.gated_graph_conv(m, g, x), st
12671267
end

GNNlib/src/layers/conv.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function gated_graph_conv(l, g::GNNGraph, x::AbstractMatrix)
228228
m = view(l.weight, :, :, i) * h
229229
m = propagate(copy_xj, g, l.aggr; xj = m)
230230
# in gru forward, hidden state is first argument, input is second
231-
h, _ = l.gru(h, m)
231+
h = l.gru(m, h)
232232
end
233233
return h
234234
end

0 commit comments

Comments
 (0)