提交 781d87bd authored 作者: João Victor Risso's avatar João Victor Risso

Use higher tolerances for spatial transformer test when using float16

上级 ff725431
...@@ -2469,8 +2469,8 @@ def test_dnn_spatialtf(): ...@@ -2469,8 +2469,8 @@ def test_dnn_spatialtf():
st_cpu_func = theano.function([t_img, t_theta], st_cpu, mode=mode_without_gpu) st_cpu_func = theano.function([t_img, t_theta], st_cpu, mode=mode_without_gpu)
img_out_cpu = st_cpu_func(img, theta) img_out_cpu = st_cpu_func(img, theta)
atol, rtol = None, None atol, rtol = None, None # use default absolute and relative error tolerances
if theano.config.floatX == 'float16': if theano.config.floatX == 'float16': # float16 requires higher tolerances
atol, rtol = 1e-0, 1e-2 atol, rtol = 1e-0, 1e-2
utt.assert_allclose(img_out_cpu, img_out_gpu, atol=atol, rtol=rtol) utt.assert_allclose(img_out_cpu, img_out_gpu, atol=atol, rtol=rtol)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论