提交 edaab6c4 authored 作者: Frederic's avatar Frederic

Do not store in the node the stack trace as this is already in the var

上级 628d17de
......@@ -2226,17 +2226,14 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
# optimize the fgraph
compute_test_value_orig = theano.config.compute_test_value
add_stack_trace_on_call = gof.Op.add_stack_trace_on_call
try:
theano.config.compute_test_value = theano.config.compute_test_value_opt
gof.Op.add_stack_trace_on_call = False # Should it be 0 == i?
optimizer(fgraph)
theano.compile.function_module.insert_deepcopy(fgraph, inputs,
outputs + additional_outputs)
finally:
theano.config.compute_test_value = compute_test_value_orig
gof.Op.add_stack_trace_on_call = add_stack_trace_on_call
if i:
li = fgraph.equivalence_tracker.event_list
......
......@@ -1235,13 +1235,11 @@ class FunctionMaker(object):
optimizer, linker = mode.optimizer, copy.copy(mode.linker)
if need_opt:
compute_test_value_orig = theano.config.compute_test_value
add_stack_trace_on_call_orig = gof.Op.add_stack_trace_on_call
limit_orig = theano.config.traceback.limit
# Why we add stack on node when it get done in output var?
try:
# optimize the fgraph
theano.config.compute_test_value = theano.config.compute_test_value_opt
gof.Op.add_stack_trace_on_call = False
theano.config.traceback.limit = 0
start_optimizer = time.time()
......@@ -1264,7 +1262,6 @@ class FunctionMaker(object):
insert_deepcopy(fgraph, inputs, outputs + additional_outputs)
finally:
theano.config.compute_test_value = compute_test_value_orig
gof.Op.add_stack_trace_on_call = add_stack_trace_on_call_orig
theano.config.traceback.limit = limit_orig
# initialize the linker
......@@ -1411,15 +1408,12 @@ class FunctionMaker(object):
# Get a function instance
start_linker = time.time()
start_import_time = theano.gof.cmodule.import_time
add_stack_trace_on_call_orig = gof.Op.add_stack_trace_on_call
limit_orig = theano.config.traceback.limit
try:
gof.Op.add_stack_trace_on_call = False
theano.config.traceback.limit = 0
_fn, _i, _o = self.linker.make_thunk(
input_storage=input_storage_lists)
finally:
gof.Op.add_stack_trace_on_call = add_stack_trace_on_call_orig
theano.config.traceback.limit = limit_orig
end_linker = time.time()
......
......@@ -413,13 +413,6 @@ class PureOp(object):
"""
add_stack_trace_on_call = True
"""This class variable governs whether __call__ adds a stack trace to the node it creates.
The tag trace is meant to connect a node to the line a user typed. It is nice for
debugging. It does not make as much sense during optimizations to store this information.
"""
#############
# make_node #
#############
......@@ -486,8 +479,6 @@ class PureOp(object):
"""
return_list = kwargs.pop('return_list', False)
node = self.make_node(*inputs, **kwargs)
if self.add_stack_trace_on_call:
self.add_tag_trace(node)
if config.compute_test_value != 'off':
run_perform = True
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论