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-scatter
Commits
c8348c05
Commit
c8348c05
authored
Dec 16, 2017
by
rusty1s
Browse files
added test
parent
fe98b763
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
6 deletions
+11
-6
build.py
build.py
+4
-4
test/test_add.py
test/test_add.py
+5
-0
torch_scatter/src/cpu.c
torch_scatter/src/cpu.c
+1
-1
torch_scatter/src/cpu.h
torch_scatter/src/cpu.h
+0
-0
torch_scatter/src/generic/cpu.c
torch_scatter/src/generic/cpu.c
+1
-1
No files found.
build.py
View file @
c8348c05
...
...
@@ -4,9 +4,9 @@ from torch.utils.ffi import create_extension
abs_path
=
osp
.
join
(
osp
.
dirname
(
osp
.
realpath
(
__file__
)),
'torch_scatter'
)
headers
=
[
'torch_scatter/
include/scatter
.h'
]
sources
=
[
'torch_scatter/src/
scatter
.c'
]
includes
=
[
osp
.
join
(
abs_path
,
'include'
),
osp
.
join
(
abs_path
,
'
src'
)
]
headers
=
[
'torch_scatter/
src/cpu
.h'
]
sources
=
[
'torch_scatter/src/
cpu
.c'
]
includes
=
[
'torch_scatter/
src'
]
defines
=
[]
extra_objects
=
[]
with_cuda
=
False
...
...
@@ -17,7 +17,7 @@ ffi = create_extension(
verbose
=
True
,
headers
=
headers
,
sources
=
sources
,
includes
=
includes
,
include
_dir
s
=
includes
,
define_macros
=
defines
,
extra_objects
=
extra_objects
,
with_cuda
=
with_cuda
,
...
...
test/test_add.py
View file @
c8348c05
from
torch_scatter._ext
import
scatter
def
test_scatter_add
():
pass
torch_scatter/src/
scatter
.c
→
torch_scatter/src/
cpu
.c
View file @
c8348c05
...
...
@@ -7,5 +7,5 @@ inline void check_inBoundaries(int idx, int size, long *free) {
if
(
idx
<
0
||
idx
>=
size
)
{
THFree
(
free
);
THError
(
"Invalid index"
);
}
}
#include "generic/
scatter
.c"
#include "generic/
cpu
.c"
#include "THGenerateAllTypes.h"
torch_scatter/
include/scatter
.h
→
torch_scatter/
src/cpu
.h
View file @
c8348c05
File moved
torch_scatter/src/generic/
scatter
.c
→
torch_scatter/src/generic/
cpu
.c
View file @
c8348c05
#ifndef TH_GENERIC_FILE
#define TH_GENERIC_FILE "generic/
scatter
.c"
#define TH_GENERIC_FILE "generic/
cpu
.c"
#else
inline
void
check_
(
asserts
)(
THTensor
*
output
,
THLongTensor
*
index
,
THTensor
*
input
,
int
dim
)
{
...
...
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