提交 7266073f authored 作者: Frederic's avatar Frederic

fix pep8

上级 2a97ffff
......@@ -28,8 +28,8 @@ def test_pydotprint_cond_highlight():
raise SkipTest('pydot not available')
x = tensor.dvector()
f = theano.function([x], x*2)
f([1,2,3,4])
f = theano.function([x], x * 2)
f([1, 2, 3, 4])
s = StringIO.StringIO()
new_handler = logging.StreamHandler(s)
......@@ -39,19 +39,21 @@ def test_pydotprint_cond_highlight():
theano.theano_logger.removeHandler(orig_handler)
theano.theano_logger.addHandler(new_handler)
try:
theano.printing.pydotprint(f, cond_highlight = True, print_output_file=False)
theano.printing.pydotprint(f, cond_highlight=True,
print_output_file=False)
finally:
theano.theano_logger.addHandler(orig_handler)
theano.theano_logger.removeHandler(new_handler)
assert s.getvalue() == 'pydotprint: cond_highlight is set but there is no IfElse node in the graph\n'
assert (s.getvalue() == 'pydotprint: cond_highlight is set but there'
' is no IfElse node in the graph\n')
def test_pydotprint_profile():
"""Just check that pydotprint does not crash with ProfileMode."""
A = tensor.matrix()
f = theano.function([A], A+1, mode='ProfileMode')
f = theano.function([A], A + 1, mode='ProfileMode')
theano.printing.pydotprint(f, print_output_file=False)
......@@ -59,12 +61,12 @@ def test_min_informative_str():
""" evaluates a reference output to make sure the
min_informative_str function works as intended """
A = tensor.matrix(name = 'A')
B = tensor.matrix(name = 'B')
A = tensor.matrix(name='A')
B = tensor.matrix(name='B')
C = A + B
C.name = 'C'
D = tensor.matrix(name = 'D')
E = tensor.matrix(name = 'E')
D = tensor.matrix(name='D')
E = tensor.matrix(name='E')
F = D + E
G = C + F
......@@ -78,7 +80,7 @@ def test_min_informative_str():
E. E"""
if mis != reference:
print '--'+mis+'--'
print '--'+reference+'--'
print '--' + mis + '--'
print '--' + reference + '--'
assert mis == reference
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论