Skip to content

Commit 942de6d

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

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

GNNlib/src/layers/conv.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ function gat_conv(l, g::AbstractGNNGraph, x, e::Union{Nothing, AbstractMatrix} =
139139
α = dropout(α, l.dropout)
140140
β = α .* m.Wxj
141141
x = aggregate_neighbors(g, +, β)
142+
if isempty(x)
143+
return zeros(eltype(x), (length(l.bias), 0))
144+
end
142145

143146
if !l.concat
144147
x = mean(x, dims = 2)

0 commit comments

Comments
 (0)