提交 c1a5a13a authored 作者: Frederic Bastien's avatar Frederic Bastien

fix test in float32.

上级 f0654f24
...@@ -3312,8 +3312,13 @@ def test_mod_compile(): ...@@ -3312,8 +3312,13 @@ def test_mod_compile():
f = theano.function([x,y],out) f = theano.function([x,y],out)
def test_unalign(): def test_unalign():
a = numpy.empty(1e4, dtype="b1,f8")['f1'] if config.floatX == 'float64':
b = numpy.empty(1e4, dtype="b1,f8")['f1'] dtype="b1,f8"
else:
dtype="b1,f4"
a = numpy.empty(1e4, dtype=dtype)['f1']
b = numpy.empty(1e4, dtype=dtype)['f1']
assert not a.flags.aligned assert not a.flags.aligned
assert not b.flags.aligned assert not b.flags.aligned
a[:] = numpy.random.rand(len(a)) a[:] = numpy.random.rand(len(a))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论