提交 e0c1c716 authored 作者: Razvan Pascanu's avatar Razvan Pascanu 提交者: David Warde-Farley

fix a test to use scalar conditions (generic don't really make sense)

上级 e813f4f2
...@@ -94,7 +94,7 @@ class NotImplementedOp(PureOp): ...@@ -94,7 +94,7 @@ class NotImplementedOp(PureOp):
def test_ifelse(): def test_ifelse():
a = generic() a = T.scalar()
b = generic() b = generic()
c = generic() c = generic()
...@@ -105,15 +105,15 @@ def test_ifelse(): ...@@ -105,15 +105,15 @@ def test_ifelse():
try: try:
print "case 1" print "case 1"
f( True, 'a', 'b') f( 1, 'a', 'b')
assert False assert False
except NotImplementedOp.E: except NotImplementedOp.E:
pass pass
print "... passed" print "... passed"
print "case 2" print "case 2"
print f( False, 'a', 'b') print f( 0, 'a', 'b')
assert f( False, 'a', 'b') == 'b' assert f( 0, 'a', 'b') == 'b'
print "... passed" print "... passed"
...@@ -123,8 +123,8 @@ def more_complex_test(): ...@@ -123,8 +123,8 @@ def more_complex_test():
x1 = T.scalar('x1') x1 = T.scalar('x1')
x2 = T.scalar('x2') x2 = T.scalar('x2')
c1 = generic('c1') c1 = T.scalar('c1')
c2 = generic('c2') c2 = T.scalar('c2')
t1 = ifelse(c1,x1,notimpl(x2)) t1 = ifelse(c1,x1,notimpl(x2))
t1.name = 't1' t1.name = 't1'
t2 = t1*10 t2 = t1*10
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论