提交 eb134abc authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Added more comments in test

上级 ec2e1a41
......@@ -5153,6 +5153,10 @@ class test_complex_mod(unittest.TestCase):
class test_size(unittest.TestCase):
"""
Ensure the `size` attribute of tensors behaves as in numpy.
"""
def test_matrix(self):
x = tensor.matrix()
y = numpy.zeros((5, 7))
......@@ -5169,6 +5173,7 @@ class test_size(unittest.TestCase):
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))
x = tensor.shared(y)
assert y.size == function([], x.size)()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论