Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pycodegen
pystencils_autodiff
Commits
a9797544
Commit
a9797544
authored
Dec 16, 2019
by
Stephan Seitz
Browse files
Make test_tfmad_gradient_check_torch_native also pass with CUDA
with_cuda needed to be True not 'with_cuda'
parent
0e367089
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/test_tfmad.py
View file @
a9797544
...
...
@@ -231,7 +231,7 @@ def test_tfmad_gradient_check_torch_native(with_offsets, with_cuda):
[
dict
[
f
]
for
f
in
auto_diff
.
forward_input_fields
]),
atol
=
1e-4
,
raise_exception
=
True
)
@
pytest
.
mark
.
parametrize
(
'with_cuda'
,
(
False
,
'with_cuda'
))
@
pytest
.
mark
.
parametrize
(
'with_cuda'
,
(
False
,
True
))
def
test_tfmad_gradient_check_two_outputs
(
with_cuda
):
torch
=
pytest
.
importorskip
(
'torch'
)
import
torch
...
...
@@ -274,9 +274,9 @@ def test_tfmad_gradient_check_two_outputs(with_cuda):
dict
=
{
a
:
a_tensor
,
b
:
b_tensor
,
out1
_tensor
:
out1_tensor
,
out2
_tensor
:
out2_tensor
,
out3
_tensor
:
out3_tensor
,
out1
:
out1_tensor
,
out2
:
out2_tensor
,
out3
:
out3_tensor
,
}
torch
.
autograd
.
gradcheck
(
function
.
apply
,
tuple
(
[
dict
[
f
]
for
f
in
auto_diff
.
forward_input_fields
]),
atol
=
1e-4
,
raise_exception
=
True
)
...
...
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