提交 e2a5c01f authored 作者: notoraptor's avatar notoraptor

Fix properly the warning code that must be showed

when g++ is not detected but the user has not set the cxx flag.
上级 3cfe6ed8
#!/usr/bin/env python #!/usr/bin/env python
import theano_cache import theano_cache
theano_cache.main() theano_cache.main()
\ No newline at end of file
#!/usr/bin/env python #!/usr/bin/env python
import theano_nose import theano_nose
theano_nose.main() theano_nose.main()
\ No newline at end of file
#!/usr/bin/env python #!/usr/bin/env python
import theano_test import theano_test
theano_test.main() theano_test.main()
\ No newline at end of file
...@@ -488,19 +488,14 @@ else: ...@@ -488,19 +488,14 @@ else:
"Default linker used if the theano flags mode is Mode", "Default linker used if the theano flags mode is Mode",
EnumStr('vm', 'py', 'vm_nogc'), EnumStr('vm', 'py', 'vm_nogc'),
in_c_key=False) in_c_key=False)
try: if type(config).cxx.is_default:
# If the user provided an empty value for cxx, do not warn. # If the user provided an empty value for cxx, do not warn.
theano.configparser.fetch_val_for_key('cxx') _logger.warning(
except KeyError: 'g++ not detected ! Theano will be unable to execute '
# This warning is strangely showed on Windows even if cxx is set to an empty value in THEANO_FLAGS. 'optimized C-implementations (for both CPU and GPU) and will '
# I add this test to ensure we do not warn if it's the user who provided a value for cxx on Windows. 'default to Python implementations. Performance will be severely '
if sys.platform != 'win32' or 'THEANO_FLAGS' not in os.environ or 'cxx=' not in os.environ['THEANO_FLAGS']: 'degraded. To remove this warning, set Theano flags cxx to an '
_logger.warning( 'empty string.')
'g++ not detected ! Theano will be unable to execute '
'optimized C-implementations (for both CPU and GPU) and will '
'default to Python implementations. Performance will be severely '
'degraded. To remove this warning, set Theano flags cxx to an '
'empty string.')
# Keep the default value the same as the one for the mode FAST_RUN # Keep the default value the same as the one for the mode FAST_RUN
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论