Unverified Commit 80fb4dbe authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[Doc] fix examples (#3747)

parent 9e358dfe
...@@ -45,17 +45,17 @@ class APPNPConv(nn.Module): ...@@ -45,17 +45,17 @@ class APPNPConv(nn.Module):
>>> feat = th.ones(6, 10) >>> feat = th.ones(6, 10)
>>> conv = APPNPConv(k=3, alpha=0.5) >>> conv = APPNPConv(k=3, alpha=0.5)
>>> res = conv(g, feat) >>> res = conv(g, feat)
>>> res >>> print(res)
tensor([[1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, tensor([[0.8536, 0.8536, 0.8536, 0.8536, 0.8536, 0.8536, 0.8536, 0.8536, 0.8536,
1.0000], 0.8536],
[1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, [0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268,
1.0000], 0.9268],
[1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, [0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634,
1.0000], 0.9634],
[1.0303, 1.0303, 1.0303, 1.0303, 1.0303, 1.0303, 1.0303, 1.0303, 1.0303, [0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268, 0.9268,
1.0303], 0.9268],
[0.8643, 0.8643, 0.8643, 0.8643, 0.8643, 0.8643, 0.8643, 0.8643, 0.8643, [0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634, 0.9634,
0.8643], 0.9634],
[0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, [0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000, 0.5000,
0.5000]]) 0.5000]])
""" """
......
...@@ -75,7 +75,7 @@ class SGConv(nn.Module): ...@@ -75,7 +75,7 @@ class SGConv(nn.Module):
>>> g = dgl.graph(([0,1,2,3,2,5], [1,2,3,4,0,3])) >>> g = dgl.graph(([0,1,2,3,2,5], [1,2,3,4,0,3]))
>>> g = dgl.add_self_loop(g) >>> g = dgl.add_self_loop(g)
>>> feat = th.ones(6, 10) >>> feat = th.ones(6, 10)
>>> conv = SGConv(10, 2, k=2, cached=True) >>> conv = SGConv(10, 2, k=2)
>>> res = conv(g, feat) >>> res = conv(g, feat)
>>> res >>> res
tensor([[-1.9441, -0.9343], tensor([[-1.9441, -0.9343],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment