提交 3b1b4afe authored 作者: notoraptor's avatar notoraptor

Ensure the warning about missing G++ is not showed on Windows

if the user does explicitely set the cxx config flag in THEANO_FLAGS.
上级 0f446def
......@@ -492,12 +492,15 @@ else:
# If the user provided an empty value for cxx, do not warn.
theano.configparser.fetch_val_for_key('cxx')
except KeyError:
_logger.warning(
'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.')
# This warning is strangely showed on Windows even if cxx is set to an empty value in THEANO_FLAGS.
# I add this test to ensure we do not warn if it's the user who provided a value for cxx on Windows.
if sys.platform != 'win32' or 'THEANO_FLAGS' not in os.environ or 'cxx=' not in os.environ['THEANO_FLAGS']:
_logger.warning(
'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
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论