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
torch-sparse
Commits
a597b822
Commit
a597b822
authored
Mar 21, 2020
by
rusty1s
Browse files
only cpu test
parent
eda4b3d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
test/test_saint.py
test/test_saint.py
+2
-6
No files found.
test/test_saint.py
View file @
a597b822
import
pytest
import
torch
import
torch
from
torch_sparse.tensor
import
SparseTensor
from
torch_sparse.tensor
import
SparseTensor
from
.utils
import
devices
def
test_saint_subgraph
():
@
pytest
.
mark
.
parametrize
(
'device'
,
devices
)
def
test_saint_subgraph
(
device
):
row
=
torch
.
tensor
([
0
,
0
,
1
,
1
,
2
,
2
,
2
,
3
,
3
,
4
])
row
=
torch
.
tensor
([
0
,
0
,
1
,
1
,
2
,
2
,
2
,
3
,
3
,
4
])
col
=
torch
.
tensor
([
1
,
2
,
0
,
2
,
0
,
1
,
3
,
2
,
4
,
3
])
col
=
torch
.
tensor
([
1
,
2
,
0
,
2
,
0
,
1
,
3
,
2
,
4
,
3
])
adj
=
SparseTensor
(
row
=
row
,
col
=
col
)
.
to
(
device
)
adj
=
SparseTensor
(
row
=
row
,
col
=
col
)
node_idx
=
torch
.
tensor
([
0
,
1
,
2
])
node_idx
=
torch
.
tensor
([
0
,
1
,
2
])
adj
,
edge_index
=
adj
.
saint_subgraph
(
node_idx
)
adj
,
edge_index
=
adj
.
saint_subgraph
(
node_idx
)
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