提交 5db2afeb authored 作者: Frederic's avatar Frederic

Add the option pdb to compute_test_value and compute_test_value_opt

上级 b1425c93
...@@ -379,7 +379,7 @@ AddConfigVar('compute_test_value', ...@@ -379,7 +379,7 @@ AddConfigVar('compute_test_value',
"Constants, SharedVariables and the tag 'test_value' as inputs " "Constants, SharedVariables and the tag 'test_value' as inputs "
"to the function. This helps the user track down problems in the " "to the function. This helps the user track down problems in the "
"graph before it gets optimized."), "graph before it gets optimized."),
EnumStr('off', 'ignore', 'warn', 'raise'), EnumStr('off', 'ignore', 'warn', 'raise', 'pdb'),
in_c_key=False) in_c_key=False)
...@@ -387,7 +387,7 @@ AddConfigVar('compute_test_value_opt', ...@@ -387,7 +387,7 @@ AddConfigVar('compute_test_value_opt',
("For debugging Theano optimization only." ("For debugging Theano optimization only."
" Same as compute_test_value, but is used" " Same as compute_test_value, but is used"
" durint Theano optimizatoin"), " durint Theano optimizatoin"),
EnumStr('off', 'ignore', 'warn', 'raise'), EnumStr('off', 'ignore', 'warn', 'raise', 'pdb'),
in_c_key=False) in_c_key=False)
"""Note to developers: """Note to developers:
......
...@@ -13,6 +13,7 @@ __contact__ = "theano-dev <theano-dev@googlegroups.com>" ...@@ -13,6 +13,7 @@ __contact__ = "theano-dev <theano-dev@googlegroups.com>"
__docformat__ = "restructuredtext en" __docformat__ = "restructuredtext en"
import logging import logging
import sys
import warnings import warnings
import theano import theano
...@@ -408,6 +409,9 @@ class PureOp(object): ...@@ -408,6 +409,9 @@ class PureOp(object):
elif config.compute_test_value == 'ignore': elif config.compute_test_value == 'ignore':
# silently skip test # silently skip test
run_perform = False run_perform = False
elif config.compute_test_value == 'pdb':
import pdb
pdb.post_mortem(sys.exc_info()[2])
else: else:
raise ValueError('%s is invalid for option config.compute_Test_value' % config.compute_test_value) raise ValueError('%s is invalid for option config.compute_Test_value' % config.compute_test_value)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论