提交 7eddfc50 authored 作者: João Victor Risso's avatar João Victor Risso

Use higher error tolerances for float32 type in spatial transformer grad test

上级 19911b2e
......@@ -2512,5 +2512,11 @@ def test_dnn_spatialtf_grad():
out = dnn.dnn_spatialtf(inputs, theta)
return out
atol, rtol = 1e-3, 1e-3
if theano.config.floatX == 'float32': # use higher error tolerances with float32
atol, rtol = 1e-0, 1e-1
# Using float16 currently produces an infinite absolute error,
# thus the following test fails
utt.verify_grad(grad_functor, [inputs_val, theta_val], mode=mode_with_gpu,
abs_tol=1e-3, rel_tol=1e-3)
abs_tol=atol, rel_tol=rtol)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论