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
421c3622
Unverified
Commit
421c3622
authored
Dec 20, 2021
by
Jinjing Zhou
Committed by
GitHub
Dec 20, 2021
Browse files
Update train_dist.py (#3594)
Co-authored-by:
Quan (Andy) Gan
<
coin2028@hotmail.com
>
parent
5eca59d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
examples/pytorch/graphsage/experimental/train_dist.py
examples/pytorch/graphsage/experimental/train_dist.py
+1
-1
No files found.
examples/pytorch/graphsage/experimental/train_dist.py
View file @
421c3622
...
@@ -172,7 +172,7 @@ def pad_data(nids):
...
@@ -172,7 +172,7 @@ def pad_data(nids):
if
max_num_nodes
>
nids_length
:
if
max_num_nodes
>
nids_length
:
pad_size
=
max_num_nodes
%
nids_length
pad_size
=
max_num_nodes
%
nids_length
repeat_size
=
max_num_nodes
//
nids_length
repeat_size
=
max_num_nodes
//
nids_length
new_nids
=
th
.
cat
([
nids
for
_
in
repeat_size
]
+
[
nids
[:
pad_size
]],
axis
=
0
)
new_nids
=
th
.
cat
([
nids
for
_
in
range
(
repeat_size
)
]
+
[
nids
[:
pad_size
]],
axis
=
0
)
print
(
"Pad nids from {} to {}"
.
format
(
nids_length
,
max_num_nodes
))
print
(
"Pad nids from {} to {}"
.
format
(
nids_length
,
max_num_nodes
))
else
:
else
:
new_nids
=
nids
new_nids
=
nids
...
...
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