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
f3d82a17
Commit
f3d82a17
authored
Dec 21, 2017
by
rusty1s
Browse files
bugfix
parent
601e686e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
test/test_max.py
test/test_max.py
+1
-0
torch_scatter/functions/utils.py
torch_scatter/functions/utils.py
+1
-1
No files found.
test/test_max.py
View file @
f3d82a17
...
@@ -38,6 +38,7 @@ def test_scatter_max(str):
...
@@ -38,6 +38,7 @@ def test_scatter_max(str):
@
pytest
.
mark
.
parametrize
(
'str'
,
tensor_strs
)
@
pytest
.
mark
.
parametrize
(
'str'
,
tensor_strs
)
@
pytest
.
mark
.
skipif
(
not
torch
.
cuda
.
is_available
(),
reason
=
'no CUDA'
)
def
test_scatter_cuda_max
(
str
):
def
test_scatter_cuda_max
(
str
):
input
=
[[
2
,
0
,
1
,
4
,
3
],
[
0
,
2
,
1
,
3
,
4
]]
input
=
[[
2
,
0
,
1
,
4
,
3
],
[
0
,
2
,
1
,
3
,
4
]]
index
=
[[
4
,
5
,
4
,
2
,
3
],
[
0
,
0
,
2
,
2
,
1
]]
index
=
[[
4
,
5
,
4
,
2
,
3
],
[
0
,
0
,
2
,
2
,
1
]]
...
...
torch_scatter/functions/utils.py
View file @
f3d82a17
...
@@ -12,7 +12,7 @@ def gen_filled_tensor(input, size, fill_value):
...
@@ -12,7 +12,7 @@ def gen_filled_tensor(input, size, fill_value):
def
gen_output
(
index
,
input
,
dim
,
dim_size
,
fill_value
):
def
gen_output
(
index
,
input
,
dim
,
dim_size
,
fill_value
):
if
dim_size
is
None
:
if
dim_size
is
None
:
dim_size
=
index
.
max
()
+
1
dim_size
=
index
.
max
()
+
1
dim_size
=
dim
.
size
if
torch
.
is_tensor
(
input
)
else
dim_size
.
data
[
0
]
dim_size
=
dim
_
size
if
torch
.
is_tensor
(
input
)
else
dim_size
.
data
[
0
]
size
=
list
(
index
.
size
())
size
=
list
(
index
.
size
())
size
[
dim
]
=
dim_size
size
[
dim
]
=
dim_size
...
...
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