We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
softmax_edge_neighbors
1 parent 1d0edf8 commit 6fdcc51Copy full SHA for 6fdcc51
GNNlib/src/utils.jl
@@ -90,6 +90,9 @@ function softmax_edge_neighbors(g::AbstractGNNGraph, e)
90
@assert size(e)[end] == g.num_edges
91
end
92
s, t = edge_index(g)
93
+ if isempty(t)
94
+ return zeros_like(e, eltype(e), (size(e)[1:end-1]..., 0))
95
+ end
96
max_ = gather(scatter(max, e, t), t)
97
num = exp.(e .- max_)
98
den = gather(scatter(+, num, t), t)
0 commit comments