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
e0fc038d
Unverified
Commit
e0fc038d
authored
Nov 28, 2022
by
Quan (Andy) Gan
Committed by
GitHub
Nov 28, 2022
Browse files
[Test] Fix duplicate seed generation in unit test (#4961)
* fix unit test * oops
parent
566d231a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/pytorch/test_nn.py
tests/pytorch/test_nn.py
+1
-1
No files found.
tests/pytorch/test_nn.py
View file @
e0fc038d
...
@@ -1516,7 +1516,7 @@ def test_hgt(idtype, in_size, num_heads):
...
@@ -1516,7 +1516,7 @@ def test_hgt(idtype, in_size, num_heads):
sorted_y
=
m
(
sorted_g
,
sorted_x
,
sorted_ntype
,
sorted_etype
,
presorted
=
False
)
sorted_y
=
m
(
sorted_g
,
sorted_x
,
sorted_ntype
,
sorted_etype
,
presorted
=
False
)
assert
sorted_y
.
shape
==
(
g
.
num_nodes
(),
head_size
*
num_heads
)
assert
sorted_y
.
shape
==
(
g
.
num_nodes
(),
head_size
*
num_heads
)
# mini-batch
# mini-batch
train_idx
=
th
.
rand
int
(
0
,
100
,
(
10
,
)
,
dtype
=
idtype
)
train_idx
=
th
.
rand
perm
(
100
,
dtype
=
idtype
)
[:
10
]
sampler
=
dgl
.
dataloading
.
NeighborSampler
([
-
1
])
sampler
=
dgl
.
dataloading
.
NeighborSampler
([
-
1
])
train_loader
=
dgl
.
dataloading
.
DataLoader
(
g
,
train_idx
.
to
(
dev
),
sampler
,
train_loader
=
dgl
.
dataloading
.
DataLoader
(
g
,
train_idx
.
to
(
dev
),
sampler
,
batch_size
=
8
,
device
=
dev
,
batch_size
=
8
,
device
=
dev
,
...
...
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