提交 ce2ceb7b authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #3522 from julienr/profile_warning

Add warning if profile_optimizer=True but profile=False
...@@ -657,7 +657,8 @@ Detailed profiling of Theano optimizer ...@@ -657,7 +657,8 @@ Detailed profiling of Theano optimizer
You can get more detailed profiling information about the Theano You can get more detailed profiling information about the Theano
optimizer phase by setting to `True` the Theano flags optimizer phase by setting to `True` the Theano flags
:attr:`config.profile_optimizer`. :attr:`config.profile_optimizer` (this require `config.profile` to be `True`
as well).
This will output something like this: This will output something like this:
......
...@@ -1459,6 +1459,10 @@ class FunctionMaker(object): ...@@ -1459,6 +1459,10 @@ class FunctionMaker(object):
if theano.config.profile_optimizer: if theano.config.profile_optimizer:
profile.optimizer_profile = (optimizer, profile.optimizer_profile = (optimizer,
optimizer_profile) optimizer_profile)
elif theano.config.profile_optimizer:
warnings.warn((
"config.profile_optimizer requires config.profile to "
" be set to True as well"), stacklevel=3)
_logger.debug('Optimizing took %f seconds', opt_time) _logger.debug('Optimizing took %f seconds', opt_time)
# Add deep copy to respect the memory interface # Add deep copy to respect the memory interface
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论