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
47c96dd1
Unverified
Commit
47c96dd1
authored
Aug 18, 2020
by
Mufei Li
Committed by
GitHub
Aug 18, 2020
Browse files
[Test] Remove Test for metapath_random_walk (#2039)
* Update test_randomwalk.py * Update test_randomwalk.py
parent
aa19df1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
26 deletions
+0
-26
tests/compute/test_randomwalk.py
tests/compute/test_randomwalk.py
+0
-26
No files found.
tests/compute/test_randomwalk.py
View file @
47c96dd1
...
...
@@ -59,29 +59,3 @@ def test_random_walk_with_restart():
for
t
in
traces_per_seed
:
trace_diff
=
np
.
diff
(
F
.
zerocopy_to_numpy
(
t
),
axis
=-
1
)
assert
(
trace_diff
%
2
==
0
).
all
()
def
test_metapath_random_walk
(
idtype
=
F
.
int32
):
g1
=
dgl
.
heterograph
({
(
'a'
,
'ab'
,
'b'
):
([
0
,
1
,
2
,
3
],
[
0
,
1
,
2
,
3
])
},
idtype
=
idtype
)
g2
=
dgl
.
heterograph
({
(
'b'
,
'ba'
,
'a'
):
([
0
,
0
,
1
,
1
,
2
,
2
,
3
,
3
],
[
1
,
3
,
2
,
0
,
3
,
1
,
0
,
2
])
},
idtype
=
idtype
)
G
=
dgl
.
heterograph
({
(
'a'
,
'ab'
,
'b'
):
([
0
,
1
,
2
,
3
],
[
0
,
1
,
2
,
3
]),
(
'b'
,
'ba'
,
'a'
):
([
0
,
0
,
1
,
1
,
2
,
2
,
3
,
3
],
[
1
,
3
,
2
,
0
,
3
,
1
,
0
,
2
])
},
idtype
=
idtype
)
seeds
=
[
0
,
1
]
traces
=
dgl
.
contrib
.
sampling
.
metapath_random_walk
(
G
,
[
'ab'
,
'ba'
]
*
4
,
seeds
,
3
)
for
seed
,
traces_per_seed
in
zip
(
seeds
,
traces
):
assert
len
(
traces_per_seed
)
==
3
for
trace
in
traces_per_seed
:
assert
len
(
trace
)
==
8
trace
=
np
.
insert
(
F
.
asnumpy
(
trace
),
0
,
seed
)
for
i
in
range
(
4
):
assert
g1
.
has_edge_between
(
trace
[
2
*
i
],
trace
[
2
*
i
+
1
])
assert
g2
.
has_edge_between
(
trace
[
2
*
i
+
1
],
trace
[
2
*
i
+
2
])
if
__name__
==
'__main__'
:
# test_random_walk()
test_metapath_random_walk
(
"int32"
)
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