Skip to content

Commit e628595

Browse files
committed
fix: Gate empty result in GATConv
1 parent 8532b1c commit e628595

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

GNNlib/src/layers/conv.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,12 @@ function gat_conv(l, g::AbstractGNNGraph, x, e::Union{Nothing, AbstractMatrix} =
139139
α = dropout(α, l.dropout)
140140
β = α .* m.Wxj
141141
x = aggregate_neighbors(g, +, β)
142+
width = size(x, 1)
142143

143144
if !l.concat
144145
x = mean(x, dims = 2)
145146
end
146-
x = reshape(x, :, size(x, 3)) # return a matrix
147+
x = reshape(x, width, size(x, 3)) # return a matrix
147148
x = l.σ.(x .+ l.bias)
148149

149150
return x

0 commit comments

Comments
 (0)