提交 665861f3 authored 作者: Frederic's avatar Frederic 提交者: David Warde-Farley

fix test in float32.

上级 8ebaac2f
......@@ -5159,22 +5159,22 @@ class test_size(unittest.TestCase):
def test_matrix(self):
x = tensor.matrix()
y = numpy.zeros((5, 7))
y = numpy.zeros((5, 7), dtype = config.floatX)
assert y.size == function([x], x.size)(y)
def test_vector(self):
x = tensor.vector()
y = numpy.zeros(7)
y = numpy.zeros(7, dtype = config.floatX)
assert y.size == function([x], x.size)(y)
def test_scalar(self):
x = tensor.scalar()
y = numpy.array(7)
y = numpy.array(7, dtype = config.floatX)
assert y.size == function([x], x.size)(y)
def test_shared(self):
# NB: we also test higher order tensors at the same time.
y = numpy.zeros((1, 2, 3, 4))
y = numpy.zeros((1, 2, 3, 4), dtype = config.floatX)
x = tensor.shared(y)
assert y.size == function([], x.size)()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论