提交 6b21b44f authored 作者: Samira Ebrahimi Kahou's avatar Samira Ebrahimi Kahou

removed work around.

上级 128360d9
...@@ -2717,11 +2717,6 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'): ...@@ -2717,11 +2717,6 @@ def check_stack_trace(f_or_fgraph, ops_to_check='last', bug_print='raise'):
for output in node.outputs: for output in node.outputs:
if (not hasattr(output.tag, 'trace') or if (not hasattr(output.tag, 'trace') or
not output.tag.trace): not output.tag.trace):
# work around some optimization inserting DeepCopyOp and Elemwise without copying the trace.
from theano.compile import deep_copy_op, DeepCopyOp
if isinstance(fgraph.toposort()[-1].op,
(DeepCopyOp, theano.tensor.Elemwise)):
return True
return False return False
return True return True
...@@ -3579,9 +3579,9 @@ class Test_local_useless_alloc(unittest.TestCase): ...@@ -3579,9 +3579,9 @@ class Test_local_useless_alloc(unittest.TestCase):
# we have to change the following we should not see tensor.Alloc # we have to change the following we should not see tensor.Alloc
# in op_classes and we have to change the assert. # in op_classes and we have to change the assert.
assert tensor.Alloc in op_classes assert tensor.Alloc in op_classes
# self.assertTrue(check_stack_trace(f, ops_to_check=[tensor.Alloc]))
# Check stacktrace was copied over correctly after opt was applied # Check stacktrace was copied over correctly after opt was applied
self.assertTrue(check_stack_trace(f, ops_to_check='all'))
class Test_local_useless_inc_subtensor_alloc(unittest.TestCase): class Test_local_useless_inc_subtensor_alloc(unittest.TestCase):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论