We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent abf0f26 commit 0d24bfdCopy full SHA for 0d24bfd
src/gnngraph.jl
@@ -287,7 +287,7 @@ function normalized_adjacency(g::GNNGraph, T::DataType=Float32;
287
add_self_loops::Bool=false, dir::Symbol=:out)
288
A = adjacency_matrix(g, T; dir=dir)
289
if add_self_loops
290
- A += I
+ A = A + I
291
end
292
degs = vec(sum(A; dims=2))
293
inv_sqrtD = Diagonal(inv.(sqrt.(degs)))
@@ -345,9 +345,9 @@ function add_self_loops(g::GNNGraph{<:COO_T})
345
346
347
function add_self_loops(g::GNNGraph{<:ADJMAT_T})
348
- A = adjaceny_matrix(g)
+ A = g.graph
349
@assert g.edata === (;)
350
351
num_edges = g.num_edges + g.num_nodes
352
GNNGraph(A,
353
g.num_nodes, num_edges, g.num_graphs,
0 commit comments