def test_vector(self):
x = vector('x')
p = ptp(x, 0)
f = theano.function([x], p)
y = rand_ranged(-1000, 1000, [100])
result = f(y)
numpyResult = numpy.ptp(y, 0)
self.assertTrue(numpy.array_equal(result, numpyResult))
评论列表
文章目录