提交 66006d27 authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Update error messages in Supervisor

上级 d3bc8b81
...@@ -146,13 +146,13 @@ class Supervisor: ...@@ -146,13 +146,13 @@ class Supervisor:
def validate(self, fgraph): def validate(self, fgraph):
if config.cycle_detection == "fast" and hasattr(fgraph, "has_destroyers"): if config.cycle_detection == "fast" and hasattr(fgraph, "has_destroyers"):
if fgraph.has_destroyers(self.protected): if fgraph.has_destroyers(self.protected):
raise InconsistencyError("Trying to destroy a protected" "Variable.") raise InconsistencyError("Trying to destroy protected variables.")
return True return True
if not hasattr(fgraph, "destroyers"): if not hasattr(fgraph, "destroyers"):
return True return True
for r in self.protected + list(fgraph.outputs): for r in self.protected + list(fgraph.outputs):
if fgraph.destroyers(r): if fgraph.destroyers(r):
raise InconsistencyError("Trying to destroy a protected" "Variable.", r) raise InconsistencyError(f"Trying to destroy a protected variable: {r}")
def std_fgraph(input_specs, output_specs, accept_inplace=False): def std_fgraph(input_specs, output_specs, accept_inplace=False):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论