提交 926c5775 authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: Frederic

Small test change to make DebugMode error appear earlier.

上级 a4bf4d3d
...@@ -2648,6 +2648,7 @@ class T_Scan(unittest.TestCase): ...@@ -2648,6 +2648,7 @@ class T_Scan(unittest.TestCase):
fn_rop = theano.function([u, h0, W, eu, eh0, eW], fn_rop = theano.function([u, h0, W, eu, eh0, eW],
[nwo_u, nwo_h0, nwo_W, o], [nwo_u, nwo_h0, nwo_W, o],
on_unused_input='ignore') on_unused_input='ignore')
vnu, vnh0, vnW, vno = fn_rop(v_u, v_h0, v_W, v_eu, v_eh0, v_eW)
n2o_u, _ = theano.scan(lambda i, o, u, h0, W, eu: \ n2o_u, _ = theano.scan(lambda i, o, u, h0, W, eu: \
(theano.tensor.grad(o[i], u) * eu).sum(), (theano.tensor.grad(o[i], u) * eu).sum(),
...@@ -2671,7 +2672,6 @@ class T_Scan(unittest.TestCase): ...@@ -2671,7 +2672,6 @@ class T_Scan(unittest.TestCase):
[n2o_u, n2o_h0, n2o_W, o], [n2o_u, n2o_h0, n2o_W, o],
on_unused_input='ignore') on_unused_input='ignore')
vnu, vnh0, vnW, vno = fn_rop(v_u, v_h0, v_W, v_eu, v_eh0, v_eW)
tnu, tnh0, tnW, tno = fn_test(v_u, v_h0, v_W, v_eu, v_eh0, v_eW) tnu, tnh0, tnW, tno = fn_test(v_u, v_h0, v_W, v_eu, v_eh0, v_eW)
utt.assert_allclose(vnu, tnu, atol=1e-6) utt.assert_allclose(vnu, tnu, atol=1e-6)
utt.assert_allclose(vnh0, tnh0, atol=1e-6) utt.assert_allclose(vnh0, tnh0, atol=1e-6)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论