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

fix for some debugmode optimizations that didn't have destroy_handler

上级 e6014b60
......@@ -2312,6 +2312,13 @@ class _Maker(FunctionMaker): # inheritance buys a few helper functions
"of", len(li), "events was stable.",
file=sys.stderr)
self.fgraph = fgraph
destroy_handler_added = False
for feature in fgraph._features:
if isinstance(feature, gof.DestroyHandler):
destroy_handler_added = True
break
if not destroy_handler_added:
fgraph.attach_feature(gof.DestroyHandler())
for o in fgraph.outputs:
try:
fgraph.replace_validate(o, _output_guard(o), reason='output_guard')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论