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
ba110e50
Unverified
Commit
ba110e50
authored
Aug 06, 2020
by
Quan (Andy) Gan
Committed by
GitHub
Aug 06, 2020
Browse files
[Bug] Fix VRGCN with new dataset (#1955)
parent
13ea9ddb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
8 deletions
+4
-8
examples/pytorch/graphsage/train_cv.py
examples/pytorch/graphsage/train_cv.py
+2
-4
examples/pytorch/graphsage/train_cv_multi_gpu.py
examples/pytorch/graphsage/train_cv_multi_gpu.py
+2
-4
No files found.
examples/pytorch/graphsage/train_cv.py
View file @
ba110e50
...
...
@@ -220,10 +220,8 @@ def run(args, dev_id, data):
# Unpack data
train_mask
,
val_mask
,
in_feats
,
labels
,
n_classes
,
g
=
data
train_nid
=
th
.
LongTensor
(
np
.
nonzero
(
train_mask
)[
0
])
val_nid
=
th
.
LongTensor
(
np
.
nonzero
(
val_mask
)[
0
])
train_mask
=
th
.
BoolTensor
(
train_mask
)
val_mask
=
th
.
BoolTensor
(
val_mask
)
train_nid
=
train_mask
.
nonzero
()[:,
0
]
val_nid
=
val_mask
.
nonzero
()[:,
0
]
# Create sampler
sampler
=
NeighborSampler
(
g
,
[
int
(
_
)
for
_
in
args
.
fan_out
.
split
(
','
)])
...
...
examples/pytorch/graphsage/train_cv_multi_gpu.py
View file @
ba110e50
...
...
@@ -262,10 +262,8 @@ def run(proc_id, n_gpus, args, devices, data):
# Unpack data
train_mask
,
val_mask
,
in_feats
,
labels
,
n_classes
,
g
=
data
train_nid
=
th
.
LongTensor
(
np
.
nonzero
(
train_mask
)[
0
])
val_nid
=
th
.
LongTensor
(
np
.
nonzero
(
val_mask
)[
0
])
train_mask
=
th
.
BoolTensor
(
train_mask
)
val_mask
=
th
.
BoolTensor
(
val_mask
)
train_nid
=
train_mask
.
nonzero
()[:,
0
]
val_nid
=
val_mask
.
nonzero
()[:,
0
]
# Split train_nid
train_nid
=
th
.
split
(
train_nid
,
math
.
ceil
(
len
(
train_nid
)
//
n_gpus
))[
proc_id
]
...
...
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