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-cluster
Commits
8c15ed64
Commit
8c15ed64
authored
Apr 06, 2018
by
rusty1s
Browse files
rename and bugfixes
parent
bebd72f3
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
15 deletions
+21
-15
aten/THC/generic/THCGrid.h
aten/THC/generic/THCGrid.h
+2
-2
aten/THCC/THCCGraclus.h
aten/THCC/THCCGraclus.h
+0
-1
aten/THCC/THCCGrid.h
aten/THCC/THCCGrid.h
+0
-1
aten/THCC/generic/THCCGraclus.c
aten/THCC/generic/THCCGraclus.c
+1
-1
aten/THCC/generic/THCCGrid.c
aten/THCC/generic/THCCGrid.c
+1
-1
build.py
build.py
+9
-9
test/test_graclus.py
test/test_graclus.py
+8
-0
No files found.
aten/THC/generic/THCGrid.h
View file @
8c15ed64
...
...
@@ -2,7 +2,7 @@
#define THC_GENERIC_FILE "generic/THCGrid.h"
#else
void
THC
G
rid
_
(
THCState
*
state
,
THCudaLongTensor
*
cluster
,
THCTensor
*
pos
,
THCTensor
*
size
,
THCudaLongTensor
*
count
);
void
THC
Tensor_
(
g
rid
)
(
THCState
*
state
,
THCudaLongTensor
*
self
,
THCTensor
*
pos
,
THCTensor
*
size
,
THCudaLongTensor
*
count
);
#endif // THC_GENERIC_FILE
aten/THCC/THCCGraclus.h
View file @
8c15ed64
...
...
@@ -5,6 +5,5 @@ void THCCCharTensor_graclus(THCudaLongTensor *self, THCudaLongTensor *row, THC
void
THCCShortTensor_graclus
(
THCudaLongTensor
*
self
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaShortTensor
*
weight
);
void
THCCIntTensor_graclus
(
THCudaLongTensor
*
self
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaIntTensor
*
weight
);
void
THCCLongTensor_graclus
(
THCudaLongTensor
*
self
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaLongTensor
*
weight
);
void
THCCHalfTensor_graclus
(
THCudaLongTensor
*
self
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaHalfTensor
*
weight
);
void
THCCFloatTensor_graclus
(
THCudaLongTensor
*
self
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaTensor
*
weight
);
void
THCCDoubleTensor_graclus
(
THCudaLongTensor
*
self
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCudaDoubleTensor
*
weight
);
aten/THCC/THCCGrid.h
View file @
8c15ed64
...
...
@@ -3,6 +3,5 @@ void THCCCharTensor_grid(THCudaLongTensor *self, THCudaCharTensor *pos, TH
void
THCCShortTensor_grid
(
THCudaLongTensor
*
self
,
THCudaShortTensor
*
pos
,
THCudaShortTensor
*
size
,
THCudaLongTensor
*
count
);
void
THCCIntTensor_grid
(
THCudaLongTensor
*
self
,
THCudaIntTensor
*
pos
,
THCudaIntTensor
*
size
,
THCudaLongTensor
*
count
);
void
THCCLongTensor_grid
(
THCudaLongTensor
*
self
,
THCudaLongTensor
*
pos
,
THCudaLongTensor
*
size
,
THCudaLongTensor
*
count
);
void
THCCHalfTensor_grid
(
THCudaLongTensor
*
self
,
THCudaHalfTensor
*
pos
,
THCudaHalfTensor
*
size
,
THCudaLongTensor
*
count
);
void
THCCFloatTensor_grid
(
THCudaLongTensor
*
self
,
THCudaTensor
*
pos
,
THCudaTensor
*
size
,
THCudaLongTensor
*
count
);
void
THCCDoubleTensor_grid
(
THCudaLongTensor
*
self
,
THCudaDoubleTensor
*
pos
,
THCudaDoubleTensor
*
size
,
THCudaLongTensor
*
count
);
aten/THCC/generic/THCCGraclus.c
View file @
8c15ed64
...
...
@@ -4,7 +4,7 @@
void
THCCTensor_
(
graclus
)(
THCudaLongTensor
*
self
,
THCudaLongTensor
*
row
,
THCudaLongTensor
*
col
,
THCTensor
*
weight
)
{
THCTensor_
(
graclus
)(
state
,
self
,
row
,
col
,
weight
);
/*
THCTensor_(graclus)(state, self, row, col, weight);
*/
}
#endif
aten/THCC/generic/THCCGrid.c
View file @
8c15ed64
...
...
@@ -4,7 +4,7 @@
void
THCCTensor_
(
grid
)(
THCudaLongTensor
*
self
,
THCTensor
*
pos
,
THCTensor
*
size
,
THCudaLongTensor
*
count
)
{
THCTensor_
(
grid
)(
state
,
self
,
pos
,
size
,
count
);
/*
THCTensor_(grid)(state, self, pos, size, count);
*/
}
#endif
...
...
build.py
View file @
8c15ed64
...
...
@@ -17,15 +17,15 @@ define_macros = []
extra_objects
=
[]
with_cuda
=
False
#
if torch.cuda.is_available():
#
subprocess.call(['./build_new.sh', osp.dirname(torch.__file__)])
#
headers += ['aten/THCC/THCC{}.h'.format(f) for f in files]
#
sources += ['aten/THCC/THCC{}.c'.format(f) for f in files]
#
include_dirs += [
'aten/THC',
'aten/THCC']
#
define_macros += [('WITH_CUDA', None)]
#
extra_objects += ['aten/build/THC.so']
#
with_cuda = True
if
torch
.
cuda
.
is_available
():
subprocess
.
call
([
'./build_new.sh'
,
osp
.
dirname
(
torch
.
__file__
)])
headers
+=
[
'aten/THCC/THCC{}.h'
.
format
(
f
)
for
f
in
files
]
sources
+=
[
'aten/THCC/THCC{}.c'
.
format
(
f
)
for
f
in
files
]
include_dirs
+=
[
'aten/THCC'
]
define_macros
+=
[(
'WITH_CUDA'
,
None
)]
extra_objects
+=
[
'aten/build/THC.so'
]
with_cuda
=
True
ffi
=
create_extension
(
name
=
'torch_cluster._ext.ffi'
,
...
...
test/test_graclus.py
View file @
8c15ed64
...
...
@@ -48,3 +48,11 @@ def test_graclus_cluster_cpu(tensor, i):
cluster
=
graclus_cluster
(
row
,
col
,
weight
)
assert_correct_graclus
(
row
,
col
,
cluster
)
def
test_graclus_cluster_gpu
():
row
=
torch
.
cuda
.
LongTensor
([
0
,
0
,
1
,
1
,
1
,
2
,
2
,
2
,
3
,
3
])
col
=
torch
.
cuda
.
LongTensor
([
1
,
2
,
0
,
2
,
3
,
0
,
1
,
3
,
1
,
2
])
cluster
=
graclus_cluster
(
row
,
col
)
print
(
cluster
.
cpu
().
tolist
())
Prev
1
2
Next
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