提交 d08c109b authored 作者: Amjad Almahairi's avatar Amjad Almahairi

adding stdout and stderr options to the output of profiling

上级 d1cef2d5
...@@ -340,11 +340,13 @@ import theano and print the config variable, as in: ...@@ -340,11 +340,13 @@ import theano and print the config variable, as in:
.. attribute:: profiling.destination .. attribute:: profiling.destination
String value String value: '', 'stderr', 'stdout', or any string
Default '' Default ''
Name of the destination file for the profiling output. Name of the destination file for the profiling output.
The profiling output can be either directed to stdout,
or stderr and any aribtrary file.
If string is empty then profiling output is directed If string is empty then profiling output is directed
to stderr. to stderr.
......
...@@ -78,11 +78,13 @@ def _atexit_print_fn(): ...@@ -78,11 +78,13 @@ def _atexit_print_fn():
""" """
to_sum = [] to_sum = []
if config.profiling.destination == '': if config.profiling.destination in ['', 'stderr']:
destination_file = sys.stderr destination_file = sys.stderr
elif config.profiling.destination == 'stdout':
destination_file = sys.stdout
else: else:
destination_file = open(config.profiling.destination, 'w') destination_file = open(config.profiling.destination, 'w')
for ps in _atexit_print_list: for ps in _atexit_print_list:
if ps.fct_callcount or ps.compile_time > 0: if ps.fct_callcount or ps.compile_time > 0:
ps.summary(file=destination_file, ps.summary(file=destination_file,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论