Skip to content

Commit 355d352

Browse files
committed
fix: Set init in softmax_edge_neighbors
1 parent 1d0edf8 commit 355d352

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

GNNlib/src/utils.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ function softmax_edge_neighbors(g::AbstractGNNGraph, e)
9090
@assert size(e)[end] == g.num_edges
9191
end
9292
s, t = edge_index(g)
93+
if isempty(t)
94+
return zero(eltype(e))
95+
end
9396
max_ = gather(scatter(max, e, t), t)
9497
num = exp.(e .- max_)
9598
den = gather(scatter(+, num, t), t)

0 commit comments

Comments
 (0)