You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/GNNGraphs/transform.jl
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,7 @@ end
40
40
41
41
"""
42
42
add_self_loops(g::GNNHeteroGraph, edge_t::EType)
43
+
add_self_loops(g::GNNHeteroGraph)
43
44
44
45
If the source node type is the same as the destination node type in `edge_t`,
45
46
return a graph with the same features as `g` but also add self-loops
@@ -51,7 +52,10 @@ a second set of self-loops of the same type.
51
52
If the graph has edge weights for edges of type `edge_t`, the new edges will have weight 1.
52
53
53
54
If no edges of type `edge_t` exist, or all existing edges have no weight,
54
-
then all new self-loops will have no weight.
55
+
then all new self loops will have no weight.
56
+
57
+
If `edge_t` is not passed as argument, for the entire graph self-loop is added to each node for every edge type in the graph where the source and destination node types are the same.
58
+
This iterates over all edge types present in the graph, applying the self-loop addition logic to each applicable edge type.
55
59
"""
56
60
functionadd_self_loops(g::GNNHeteroGraph{Tuple{T, T, V}}, edge_t::EType) where {T <:AbstractVector{<:Integer}, V}
0 commit comments