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
0a5eeead
Commit
0a5eeead
authored
Dec 28, 2017
by
rusty1s
Browse files
first cuda, then variable call
parent
4d8ff02a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
test/test_backward.py
test/test_backward.py
+3
-3
No files found.
test/test_backward.py
View file @
0a5eeead
...
...
@@ -35,12 +35,12 @@ def test_backward_cpu(tensor, i):
@
pytest
.
mark
.
parametrize
(
'tensor,i'
,
product
(
tensors
,
range
(
len
(
data
))))
def
test_backward_gpu
(
tensor
,
i
):
# pragma: no cover
name
=
data
[
i
][
'name'
]
index
=
V
(
torch
.
LongTensor
(
data
[
i
][
'index'
])
)
.
cuda
()
input
=
V
(
Tensor
(
tensor
,
data
[
i
][
'input'
]),
requires_grad
=
True
)
.
cuda
()
index
=
V
(
torch
.
LongTensor
(
data
[
i
][
'index'
]).
cuda
()
)
input
=
V
(
Tensor
(
tensor
,
data
[
i
][
'input'
])
.
cuda
()
,
requires_grad
=
True
)
dim
=
data
[
i
][
'dim'
]
fill_value
=
data
[
i
][
'fill_value'
]
grad
=
Tensor
(
tensor
,
data
[
i
][
'grad'
]).
cuda
()
output
=
V
(
grad
.
new
(
grad
.
size
()).
fill_
(
fill_value
)
)
.
cuda
()
output
=
V
(
grad
.
new
(
grad
.
size
()).
fill_
(
fill_value
).
cuda
()
)
expected
=
Tensor
(
tensor
,
data
[
i
][
'expected'
])
func
=
getattr
(
torch_scatter
,
'scatter_{}_'
.
format
(
name
))
...
...
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