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
fb3459ad
"docs/source/vscode:/vscode.git/clone" did not exist on "8425c936c2412b1e2521fa864be02b4a3830a9bf"
Commit
fb3459ad
authored
Apr 14, 2020
by
rusty1s
Browse files
update
parent
9c3519b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
csrc/metis.cpp
csrc/metis.cpp
+2
-2
test/test_metis.py
test/test_metis.py
+3
-2
No files found.
csrc/metis.cpp
View file @
fb3459ad
#include "cpu/metis_cpu.h"
#include <Python.h>
#include <torch/script.h>
#include "cpu/metis_cpu.h"
#ifdef _WIN32
PyMODINIT_FUNC
PyInit__metis
(
void
)
{
return
NULL
;
}
#endif
...
...
test/test_metis.py
View file @
fb3459ad
...
...
@@ -12,11 +12,12 @@ def test_metis(device):
assert
partptr
.
numel
()
==
3
assert
perm
.
numel
()
==
6
mat
,
partptr
,
perm
=
weighted_mat
.
partition
(
num_parts
=
2
,
recursive
=
True
)
unweighted_mat
=
SparseTensor
.
from_dense
(
torch
.
ones
((
6
,
6
),
device
=
device
))
mat
,
partptr
,
perm
=
unweighted_mat
.
partition
(
num_parts
=
2
,
recursive
=
True
)
assert
partptr
.
numel
()
==
3
assert
perm
.
numel
()
==
6
unweighted_mat
=
SparseTensor
.
from_dense
(
torch
.
ones
((
6
,
6
),
device
=
devic
e
)
)
unweighted_mat
=
unweighted_mat
.
set_value
(
Non
e
)
mat
,
partptr
,
perm
=
unweighted_mat
.
partition
(
num_parts
=
2
,
recursive
=
True
)
assert
partptr
.
numel
()
==
3
assert
perm
.
numel
()
==
6
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