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

changed handling empty strings as stderr, users will just get an error message…

changed handling empty strings as stderr, users will just get an error message if they don't give a proper file name
上级 d848e91c
...@@ -340,16 +340,14 @@ import theano and print the config variable, as in: ...@@ -340,16 +340,14 @@ import theano and print the config variable, as in:
.. attribute:: profiling.destination .. attribute:: profiling.destination
String value: '', 'stderr', 'stdout', or a name of a String value: 'stderr', 'stdout', or a name of a
file to be created file to be created
Default '' Default 'stderr'
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, The profiling output can be either directed to stderr
or stderr or an arbitrary file. (default), or stdout or an arbitrary file.
If string is empty then profiling output is directed
to stderr.
.. attribute:: config.lib.amdlibm .. attribute:: config.lib.amdlibm
......
...@@ -69,7 +69,7 @@ AddConfigVar('profiling.destination', ...@@ -69,7 +69,7 @@ AddConfigVar('profiling.destination',
""" """
File destination of the profiling output File destination of the profiling output
""", """,
StrParam(''), StrParam('stderr'),
in_c_key=False) in_c_key=False)
...@@ -77,8 +77,8 @@ def _atexit_print_fn(): ...@@ -77,8 +77,8 @@ def _atexit_print_fn():
"""Print ProfileStat objects in _atexit_print_list to _atexit_print_file """Print ProfileStat objects in _atexit_print_list to _atexit_print_file
""" """
to_sum = [] to_sum = []
if config.profiling.destination in ['', 'stderr']: if config.profiling.destination == 'stderr':
destination_file = sys.stderr destination_file = sys.stderr
elif config.profiling.destination == 'stdout': elif config.profiling.destination == 'stdout':
destination_file = sys.stdout destination_file = sys.stdout
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论