提交 4ccdcdaa authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fix too broad of exception

上级 98a5be72
......@@ -297,7 +297,7 @@ if 0:
already_there = False
if self.fgraph is fgraph:
already_there = True
if self.fgraph is not None:
if self.fgraph not in [None, fgraph]:
raise Exception("A DestroyHandler instance can only serve one FunctionGraph. (Matthew 6:24)")
for attr in ('destroyers', 'destroy_handler'):
if hasattr(fgraph, attr):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论