提交 d28843ec authored 作者: Reyhane Askari's avatar Reyhane Askari

added the dummy value to warn

上级 e7064712
......@@ -3046,19 +3046,19 @@ class CheckStrackTraceFeature(object):
# In optdb we only register the CheckStackTraceOptimization when
# theano.config.check_stack_trace is not off but we also double check here.
if theano.config.check_stack_trace != 'off' and not check_stack_trace(fgraph, 'all'):
if theano.config.check_stack_trace == 'warn':
warnings.warn(
'Empty stack trace! The optimization that inserted this variable is' + str(reason))
if theano.config.check_stack_trace == 'raise':
raise NotImplementedError(
'Empty stack trace! The optimization that inserted this variable is' + str(reason))
if theano.config.check_stack_trace == 'log':
apply_nodes_to_check = fgraph.apply_nodes
for node in apply_nodes_to_check:
for output in node.outputs:
if not hasattr(output.tag, 'trace') or not output.tag.trace:
output.tag.trace = [[('', 0, 'Empty stack trace! The optimization that' +
'inserted this variable is ' + str(reason), '')]]
elif theano.config.check_stack_trace in ['log', 'warn']:
apply_nodes_to_check = fgraph.apply_nodes
for node in apply_nodes_to_check:
for output in node.outputs:
if not hasattr(output.tag, 'trace') or not output.tag.trace:
output.tag.trace = [[('', 0, 'Empty stack trace! The optimization that' +
'inserted this variable is ' + str(reason), '')]]
if theano.config.check_stack_trace == 'warn':
warnings.warn(
'Empty stack trace! The optimization that inserted this variable is' + str(reason))
class CheckStackTraceOptimization(Optimizer):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论