Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions GNNlib/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ function softmax_edge_neighbors(g::AbstractGNNGraph, e)
@assert size(e)[end] == g.num_edges
end
s, t = edge_index(g)
if isempty(t)
return zero(eltype(e))
end
max_ = gather(scatter(max, e, t), t)
num = exp.(e .- max_)
den = gather(scatter(+, num, t), t)
Expand Down
Loading