提交 ca4ebb4d authored 作者: Frederic's avatar Frederic

Use utt.assert_allclose in test

上级 db525394
...@@ -279,8 +279,7 @@ def test_pooling(): ...@@ -279,8 +279,7 @@ def test_pooling():
a = f1(data).__array__() a = f1(data).__array__()
b = f2(data).__array__() b = f2(data).__array__()
assert numpy.allclose(a, b, utt.assert_allclose(a, b)
atol=numpy.finfo(numpy.float32).eps)
# Test the grad # Test the grad
for shp in [(1, 1, 2, 2), for shp in [(1, 1, 2, 2),
...@@ -338,7 +337,7 @@ def test_pooling(): ...@@ -338,7 +337,7 @@ def test_pooling():
assert any([isinstance(node.op, AveragePoolGrad) assert any([isinstance(node.op, AveragePoolGrad)
for node in fc.maker.fgraph.toposort()]) for node in fc.maker.fgraph.toposort()])
c_out = fc(data) c_out = fc(data)
assert numpy.allclose(c_out, g_out) utt.assert_allclose(c_out, g_out)
def test_pooling3d(): def test_pooling3d():
...@@ -443,7 +442,7 @@ def test_pooling3d(): ...@@ -443,7 +442,7 @@ def test_pooling3d():
fc = theano.function([x], theano.grad(out.sum(), x), fc = theano.function([x], theano.grad(out.sum(), x),
mode=mode_without_gpu) mode=mode_without_gpu)
c_out = fc(data) c_out = fc(data)
assert numpy.allclose(c_out, g_out) utt.assert_allclose(c_out, g_out)
def test_pooling_opt(): def test_pooling_opt():
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论