提交 819c03e0 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fixes unit tests that were doing invalid subtensor operations.

these were caught by my recent input validation pull request, which was merged before travis could run on it
上级 24f2f637
...@@ -2253,7 +2253,7 @@ class Test_alloc_zero(unittest.TestCase): ...@@ -2253,7 +2253,7 @@ class Test_alloc_zero(unittest.TestCase):
def test_setsubtensor_allocs1(self): def test_setsubtensor_allocs1(self):
y = tensor.matrix() y = tensor.matrix()
x0 = tensor.constant(numpy.asarray(numpy.zeros_like((4, 4)), x0 = tensor.constant(numpy.asarray(numpy.zeros((4, 4)),
dtype=config.floatX)) dtype=config.floatX))
y0 = tensor.zeros_like(y) y0 = tensor.zeros_like(y)
z = tensor.set_subtensor(x0[:4], y0) z = tensor.set_subtensor(x0[:4], y0)
...@@ -2263,7 +2263,7 @@ class Test_alloc_zero(unittest.TestCase): ...@@ -2263,7 +2263,7 @@ class Test_alloc_zero(unittest.TestCase):
def test_setsubtensor_allocs1t(self): def test_setsubtensor_allocs1t(self):
y = tensor.matrix() y = tensor.matrix()
x0 = tensor.constant(numpy.asarray(numpy.zeros_like((4, 4)), x0 = tensor.constant(numpy.asarray(numpy.zeros((4, 4)),
dtype=config.floatX)) dtype=config.floatX))
y0 = tensor.zeros_like(y) y0 = tensor.zeros_like(y)
z = tensor.set_subtensor(x0[:4], y0.T) z = tensor.set_subtensor(x0[:4], y0.T)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论