Skip to content

Commit

Permalink
Add test for slicing symbolic vars
Browse files Browse the repository at this point in the history
  • Loading branch information
craffel committed Jul 24, 2015
1 parent 27ecbc0 commit 5f6e897
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions theano/tensor/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down

0 comments on commit 5f6e897

Please sign in to comment.