提交 4445b09b authored 作者: carriepl's avatar carriepl

Merge pull request #3134 from nouiz/tests

Fix test in float32 and try to run floatX=float32 with python 2.6 in travis.
...@@ -41,7 +41,7 @@ matrix: ...@@ -41,7 +41,7 @@ matrix:
- python: "3.3" - python: "3.3"
env: PART="." THEANO_FLAGS="mode=FAST_COMPILE" env: PART="." THEANO_FLAGS="mode=FAST_COMPILE"
- python: "2.6" - python: "2.6"
env: PART="." THEANO_FLAGS="mode=FAST_COMPILE" env: PART="." THEANO_FLAGS="mode=FAST_COMPILE,floatX=float32"
script: script:
- export THEANO_FLAGS=$THEANO_FLAGS,warn.ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise,gcc.cxxflags=-pipe - export THEANO_FLAGS=$THEANO_FLAGS,warn.ignore_bug_before=all,on_opt_error=raise,on_shape_error=raise,gcc.cxxflags=-pipe
......
...@@ -5503,7 +5503,7 @@ class TestNdGrid(unittest.TestCase): ...@@ -5503,7 +5503,7 @@ class TestNdGrid(unittest.TestCase):
mgrid[0:2:1, 1:10:1, 10:100:10]) mgrid[0:2:1, 1:10:1, 10:100:10])
for n, t in zip(nmgrid, tmgrid): for n, t in zip(nmgrid, tmgrid):
for ng, tg in zip(n, t): for ng, tg in zip(n, t):
assert_array_equal(ng, tg.eval()) utt.assert_allclose(ng, tg.eval())
def test_ogrid_numpy_equiv(self): def test_ogrid_numpy_equiv(self):
nogrid = (numpy.ogrid[0:1:.1, 1:10:1., 10:100:10.], nogrid = (numpy.ogrid[0:1:.1, 1:10:1., 10:100:10.],
...@@ -5512,7 +5512,7 @@ class TestNdGrid(unittest.TestCase): ...@@ -5512,7 +5512,7 @@ class TestNdGrid(unittest.TestCase):
ogrid[0:2:1, 1:10:1, 10:100:10]) ogrid[0:2:1, 1:10:1, 10:100:10])
for n, t in zip(nogrid, togrid): for n, t in zip(nogrid, togrid):
for ng, tg in zip(n, t): for ng, tg in zip(n, t):
assert_array_equal(ng, tg.eval()) utt.assert_allclose(ng, tg.eval())
def test_mgrid_theano_variable_numpy_equiv(self): def test_mgrid_theano_variable_numpy_equiv(self):
nfmgrid = numpy.mgrid[0:1:.1, 1:10:1., 10:100:10.] nfmgrid = numpy.mgrid[0:1:.1, 1:10:1., 10:100:10.]
...@@ -5525,7 +5525,7 @@ class TestNdGrid(unittest.TestCase): ...@@ -5525,7 +5525,7 @@ class TestNdGrid(unittest.TestCase):
fi = theano.function([l, m, n], timgrid) fi = theano.function([l, m, n], timgrid)
for n, t in zip((nfmgrid,nimgrid), (ff(0, 10, 10.),fi(0, 10, 10))): for n, t in zip((nfmgrid,nimgrid), (ff(0, 10, 10.),fi(0, 10, 10))):
for ng, tg in zip(n, t): for ng, tg in zip(n, t):
assert_array_equal(ng, tg) utt.assert_allclose(ng, tg)
def test_ogrid_theano_variable_numpy_equiv(self): def test_ogrid_theano_variable_numpy_equiv(self):
nfogrid = numpy.ogrid[0:1:.1, 1:10:1., 10:100:10.] nfogrid = numpy.ogrid[0:1:.1, 1:10:1., 10:100:10.]
...@@ -5538,7 +5538,7 @@ class TestNdGrid(unittest.TestCase): ...@@ -5538,7 +5538,7 @@ class TestNdGrid(unittest.TestCase):
fi = theano.function([l, m, n], tiogrid) fi = theano.function([l, m, n], tiogrid)
for n, t in zip((nfogrid,niogrid), (ff(0, 10, 10.),fi(0, 10, 10))): for n, t in zip((nfogrid,niogrid), (ff(0, 10, 10.),fi(0, 10, 10))):
for ng, tg in zip(n, t): for ng, tg in zip(n, t):
assert_array_equal(ng, tg) utt.assert_allclose(ng, tg)
class TestInversePermutation(unittest.TestCase): class TestInversePermutation(unittest.TestCase):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论