提交 ce8cc0f8 authored 作者: Frederic's avatar Frederic

make tests less verbose.

上级 39cf88bd
......@@ -117,17 +117,17 @@ def test_ifelse():
mode=Mode(linker=linker, optimizer='fast_run'))
try:
print "case 1"
#print "case 1"
f(1, 'a', 'b')
assert False
except NotImplementedOp.E:
pass
print "... passed"
#print "... passed"
print "case 2"
print f(0, 'a', 'b')
#print "case 2"
#print f(0, 'a', 'b')
assert f(0, 'a', 'b') == 'b'
print "... passed"
#print "... passed"
def more_complex_test():
......
......@@ -360,7 +360,7 @@ class TestEquilibrium(object):
x, y, z = map(MyVariable, 'xyz')
e = op3(op4(x, y))
g = Env([x, y, z], [e])
print g
#print g
opt = EquilibriumOptimizer(
[PatternSub((op1, 'x', 'y'), (op2, 'x', 'y')),
PatternSub((op4, 'x', 'y'), (op1, 'x', 'y')),
......@@ -368,14 +368,14 @@ class TestEquilibrium(object):
],
max_use_ratio = 10)
opt.optimize(g)
print g
#print g
assert str(g) == '[Op2(x, y)]'
def test_2(self):
x, y, z = map(MyVariable, 'xyz')
e = op1(op1(op3(x, y)))
g = Env([x, y, z], [e])
print g
#print g
opt = EquilibriumOptimizer(
[PatternSub((op1, (op2, 'x', 'y')), (op4, 'x', 'y')),
PatternSub((op3, 'x', 'y'), (op4, 'x', 'y')),
......@@ -391,7 +391,7 @@ class TestEquilibrium(object):
x, y, z = map(MyVariable, 'xyz')
e = op3(op4(x, y))
g = Env([x, y, z], [e])
print 'before', g
#print 'before', g
# display pesky warnings along with stdout
# also silence logger for 'theano.gof.opt'
_logger = logging.getLogger('theano.gof.opt')
......@@ -407,5 +407,5 @@ class TestEquilibrium(object):
opt.optimize(g)
finally:
_logger.setLevel(oldlevel)
print 'after', g
#print 'after', g
assert str(g) == '[Op1(x, y)]'
......@@ -726,7 +726,7 @@ class TestConv2DGPU(unittest.TestCase):
featshp_logical = (featshp[0], featshp[1], featshp[2] * stride,
featshp[3] * stride)
kshp_rotated = (kshp[1], kshp[0], kshp[2], kshp[3])
print featshp, kshp_rotated, featshp_logical[1:], kshp[2:]
#print featshp, kshp_rotated, featshp_logical[1:], kshp[2:]
image_estimate = tensor.nnet.conv2d(a, kernel_rotated,
border_mode='full',
image_shape=featshp,
......@@ -735,7 +735,7 @@ class TestConv2DGPU(unittest.TestCase):
kshp_logical=kshp[2:])
func = theano.function([a, A], image_estimate, mode=theano_mode)
theano.printing.debugprint(func,)
#theano.printing.debugprint(func,)
assert any([isinstance(node.op, theano.sandbox.cuda.blas.GpuConv)
for node in func.maker.fgraph.toposort()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论