"apps/vscode:/vscode.git/clone" did not exist on "ad222fb9399332e0d7aaadeec7c06f8b91126b78"
Unverified Commit 0f0e7c7f authored by Chang Liu's avatar Chang Liu Committed by GitHub
Browse files

[Example][Bugfix] Bugfix for dgi example (#4201)

parent dcf16992
......@@ -4,6 +4,7 @@ import networkx as nx
import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
from dgl import DGLGraph
from dgl.data import register_data_args, load_data
from dgi import DGI, Classifier
......@@ -49,8 +50,8 @@ def main(args):
# add self loop
if args.self_loop:
g.remove_edges_from(nx.selfloop_edges(g))
g.add_edges_from(zip(g.nodes(), g.nodes()))
g = dgl.remove_self_loop(g)
g = dgl.add_self_loop(g)
n_edges = g.number_of_edges()
if args.gpu >= 0:
......
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