提交 d56ac677 authored 作者: Matthew Rocklin's avatar Matthew Rocklin

add docstring for depends

上级 450deb87
...@@ -12,6 +12,7 @@ def memodict(f): ...@@ -12,6 +12,7 @@ def memodict(f):
@memodict @memodict
def depends((a, b)): def depends((a, b)):
""" Returns True if a depends on b """
return (any(bout in a.inputs for bout in b.outputs) return (any(bout in a.inputs for bout in b.outputs)
or any(depends((ainp.owner, b)) for ainp in a.inputs or any(depends((ainp.owner, b)) for ainp in a.inputs
if ainp.owner)) if ainp.owner))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论