提交 0a20a2eb authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1853 from Hengjean/ptp

added test for the ptp interface
...@@ -6845,6 +6845,17 @@ class test_ptp(unittest.TestCase): ...@@ -6845,6 +6845,17 @@ class test_ptp(unittest.TestCase):
self.assertTrue(numpy.array_equal(result, numpyResult)) self.assertTrue(numpy.array_equal(result, numpyResult))
def test_interface(self):
x = matrix('x')
p = x.ptp(1)
f = theano.function([x], p)
y = rand_ranged(-1000, 1000, [100, 100])
result = f(y)
numpyResult = numpy.ptp(y, 1)
self.assertTrue(numpy.array_equal(result, numpyResult))
if __name__ == '__main__': if __name__ == '__main__':
t = TestInferShape('setUp') t = TestInferShape('setUp')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论