def test_perform(self):
x = tensor.lscalar()
f = function([x], self.op(x))
M = numpy.random.randint(3, 51, size=())
assert numpy.allclose(f(M), numpy.bartlett(M))
assert numpy.allclose(f(0), numpy.bartlett(0))
assert numpy.allclose(f(-1), numpy.bartlett(-1))
b = numpy.array([17], dtype='uint8')
assert numpy.allclose(f(b[0]), numpy.bartlett(b[0]))
评论列表
文章目录