提交 72d2d3d2 authored 作者: Frederic's avatar Frederic

hide pydotprint output during tests.

上级 2046b190
......@@ -396,7 +396,8 @@ def pydotprint(fct, outfile=None,
compact=True, format='png', with_ids=False,
high_contrast=True, cond_highlight=None, colorCodes=None,
max_label_size=50, scan_graphs=False,
var_with_name_simple=False
var_with_name_simple=False,
print_output_file=True
):
"""
print to a file in png format the graph of op of a compile theano fct.
......@@ -658,7 +659,8 @@ def pydotprint(fct, outfile=None,
outfile+='.'+format
g.write(outfile, prog='dot', format=format)
print 'The output file is available at',outfile
if print_output_file:
print 'The output file is available at',outfile
if scan_graphs:
scan_ops = [(idx, x) for idx,x in enumerate(fct_env.toposort()) if isinstance(x.op, theano.scan_module.scan_op.Scan)]
path, fn = os.path.split(outfile)
......
......@@ -29,7 +29,7 @@ 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)
theano.printing.pydotprint(f, cond_highlight = True, print_output_file=False)
finally:
theano.theano_logger.addHandler(orig_handler)
theano.theano_logger.removeHandler(new_handler)
......@@ -41,7 +41,7 @@ def test_pydotprint_profile():
A = tensor.matrix()
f = theano.function([A],A+1,mode='ProfileMode')
theano.printing.pydotprint(f)
theano.printing.pydotprint(f, print_output_file=False)
def test_min_informative_str():
""" evaluates a reference output to make sure the
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论