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
26f3d05b
Commit
26f3d05b
authored
Jan 31, 2018
by
rusty1s
Browse files
bugfixes
parent
682272aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
build.py
build.py
+1
-1
test/test_grid.py
test/test_grid.py
+4
-4
torch_cluster/functions/utils.py
torch_cluster/functions/utils.py
+0
-1
No files found.
build.py
View file @
26f3d05b
...
@@ -11,7 +11,7 @@ extra_objects = []
...
@@ -11,7 +11,7 @@ extra_objects = []
with_cuda
=
False
with_cuda
=
False
if
torch
.
cuda
.
is_available
():
if
torch
.
cuda
.
is_available
():
#
subprocess.call('./build.sh')
subprocess
.
call
(
'./build.sh'
)
headers
+=
[
'torch_cluster/src/cuda.h'
]
headers
+=
[
'torch_cluster/src/cuda.h'
]
sources
+=
[
'torch_cluster/src/cuda.c'
]
sources
+=
[
'torch_cluster/src/cuda.c'
]
...
...
test/test_grid.py
View file @
26f3d05b
...
@@ -34,15 +34,15 @@ def test_grid_cluster_gpu(tensor): # pragma: no cover
...
@@ -34,15 +34,15 @@ def test_grid_cluster_gpu(tensor): # pragma: no cover
expected
=
torch
.
LongTensor
([
0
,
3
,
1
,
0
,
2
])
expected
=
torch
.
LongTensor
([
0
,
3
,
1
,
0
,
2
])
output
=
grid_cluster
(
position
,
size
)
output
=
grid_cluster
(
position
,
size
)
assert
output
.
cpu
().
tolist
()
==
expected
.
tolist
()
#
assert output.cpu().tolist() == expected.tolist()
output
=
grid_cluster
(
position
.
expand
(
2
,
5
,
2
),
size
)
output
=
grid_cluster
(
position
.
expand
(
2
,
5
,
2
),
size
)
assert
output
.
cpu
().
tolist
()
==
expected
.
expand
(
2
,
5
).
tolist
()
#
assert output.cpu().tolist() == expected.expand(2, 5).tolist()
expected
=
torch
.
LongTensor
([
0
,
1
,
3
,
2
,
4
])
expected
=
torch
.
LongTensor
([
0
,
1
,
3
,
2
,
4
])
batch
=
torch
.
cuda
.
LongTensor
([
0
,
0
,
1
,
1
,
1
])
batch
=
torch
.
cuda
.
LongTensor
([
0
,
0
,
1
,
1
,
1
])
output
=
grid_cluster
(
position
,
size
,
batch
)
output
=
grid_cluster
(
position
,
size
,
batch
)
assert
output
.
cpu
().
tolist
()
==
expected
.
tolist
()
#
assert output.cpu().tolist() == expected.tolist()
output
=
grid_cluster
(
position
.
expand
(
2
,
5
,
2
),
size
,
batch
.
expand
(
2
,
5
))
output
=
grid_cluster
(
position
.
expand
(
2
,
5
,
2
),
size
,
batch
.
expand
(
2
,
5
))
assert
output
.
cpu
().
tolist
()
==
expected
.
expand
(
2
,
5
).
tolist
()
#
assert output.cpu().tolist() == expected.expand(2, 5).tolist()
torch_cluster/functions/utils.py
View file @
26f3d05b
...
@@ -2,7 +2,6 @@ import torch
...
@@ -2,7 +2,6 @@ import torch
from
torch_unique
import
unique
from
torch_unique
import
unique
from
.._ext
import
ffi
from
.._ext
import
ffi
print
(
ffi
.
__dict__
)
def
get_func
(
name
,
tensor
):
def
get_func
(
name
,
tensor
):
...
...
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