Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
ca48787a
Commit
ca48787a
authored
Apr 23, 2019
by
Hao Zhang
Committed by
HQ
Apr 23, 2019
Browse files
fix tutorial (#506)
* Update 9_gat.py * Update 1_gcn.py
parent
3b96299a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
tutorials/models/1_gnn/1_gcn.py
tutorials/models/1_gnn/1_gcn.py
+5
-1
tutorials/models/1_gnn/9_gat.py
tutorials/models/1_gnn/9_gat.py
+5
-1
No files found.
tutorials/models/1_gnn/1_gcn.py
View file @
ca48787a
...
...
@@ -106,7 +106,11 @@ def load_cora_data():
features
=
th
.
FloatTensor
(
data
.
features
)
labels
=
th
.
LongTensor
(
data
.
labels
)
mask
=
th
.
ByteTensor
(
data
.
train_mask
)
g
=
DGLGraph
(
data
.
graph
)
g
=
data
.
graph
# add self loop
g
.
remove_edges_from
(
g
.
selfloop_edges
())
g
=
DGLGraph
(
g
)
g
.
add_edges
(
g
.
nodes
(),
g
.
nodes
())
return
g
,
features
,
labels
,
mask
###############################################################################
...
...
tutorials/models/1_gnn/9_gat.py
View file @
ca48787a
...
...
@@ -280,7 +280,11 @@ def load_cora_data():
features
=
torch
.
FloatTensor
(
data
.
features
)
labels
=
torch
.
LongTensor
(
data
.
labels
)
mask
=
torch
.
ByteTensor
(
data
.
train_mask
)
g
=
DGLGraph
(
data
.
graph
)
g
=
data
.
graph
# add self loop
g
.
remove_edges_from
(
g
.
selfloop_edges
())
g
=
DGLGraph
(
g
)
g
.
add_edges
(
g
.
nodes
(),
g
.
nodes
())
return
g
,
features
,
labels
,
mask
##############################################################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment