Skip to content

Commit

Permalink
[Misc] Small fix in sparse GCN example (dmlc#5006)
Browse files Browse the repository at this point in the history
Co-authored-by: Steve <[email protected]>
  • Loading branch information
frozenbugs and Steve authored Dec 12, 2022
1 parent e01580d commit 236fac4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/sparse/gcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ def __init__(self, in_size, out_size, hidden_size=16):
self.Theta2 = nn.Linear(hidden_size, out_size)

############################################################################
# (HIGHLIGHT) Take the advantage of DGL sparse APIs to implement
# the GCN forward process.
# (HIGHLIGHT) Take the advantage of DGL sparse APIs to implement the GCN
# forward process.
############################################################################
def forward(self, A_norm, X):
X = A_norm @ self.Theta1(X)
Expand Down Expand Up @@ -90,8 +90,8 @@ def train(model, g, A_norm, X):
A = create_from_coo(dst, src, shape=(N, N))

############################################################################
# (HIGHLIGHT) Compute the symmetrically normalized adjacency matrix
# with Sparse Matrix API
# (HIGHLIGHT) Compute the symmetrically normalized adjacency matrix with
# Sparse Matrix API
############################################################################
I = identity(A.shape, device=dev)
A_hat = A + I
Expand Down

0 comments on commit 236fac4

Please sign in to comment.