提交 5f6e897d authored 作者: Colin Raffel's avatar Colin Raffel

Add test for slicing symbolic vars

上级 27ecbc00
......@@ -7729,6 +7729,13 @@ def test_allocempty():
assert out.shape == (2, 3)
assert out.dtype == 'float32'
def test_symbolic_slice():
x = theano.tensor.tensor4('x')
a, b = x.shape[:2]
output = a.eval({x: numpy.zeros((5, 4, 3, 2), dtype=theano.config.floatX)})
assert output == numpy.array(5)
"""
if __name__ == '__main__':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论