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

Fix test with floatX=float32

上级 301c4a23
...@@ -2509,12 +2509,12 @@ class T_Clip(unittest.TestCase): ...@@ -2509,12 +2509,12 @@ class T_Clip(unittest.TestCase):
rng = numpy.random.RandomState(utt.fetch_seed()) rng = numpy.random.RandomState(utt.fetch_seed())
nvals = 50 nvals = 50
xval = rng.rand(nvals) xval = rng.rand(nvals).astype(config.floatX)
# To ensure that the min < x # To ensure that the min < x
yval_mn = rng.rand(nvals) - 1.0 yval_mn = rng.rand(nvals).astype(config.floatX) - 1.0
# To ensure that the max > x # To ensure that the max > x
yval_mx = rng.rand(nvals) + 1.0 yval_mx = rng.rand(nvals).astype(config.floatX) + 1.0
aval, = fn(xval, yval_mn) aval, = fn(xval, yval_mn)
aval2, = fn2(xval, yval_mx) aval2, = fn2(xval, yval_mx)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论