提交 47a812ab authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1857 from Hengjean/ptp

Fixed Float32 bug in test_ptp
...@@ -6786,7 +6786,12 @@ class test_ptp(unittest.TestCase): ...@@ -6786,7 +6786,12 @@ class test_ptp(unittest.TestCase):
x = scalar('x') x = scalar('x')
p = ptp(x) p = ptp(x)
f = theano.function([x], p) f = theano.function([x], p)
self.assertTrue(f(rand() * 20000 - 10000) == 0)
y = numpy.asarray(rand() * 2000 - 1000, dtype=config.floatX)
result = f(y)
numpyResult = numpy.ptp(y)
self.assertTrue(numpy.array_equal(result, numpyResult))
def test_vector(self): def test_vector(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论