提交 69697cee authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: Reyhane Askari

Small io_toposort without ordering. remove useless list copy and check (it is always a list)

上级 f46ddb95
......@@ -1002,18 +1002,10 @@ def io_toposort(inputs, outputs, orderings=None, clients=None):
if obj.owner:
rval = [obj.owner]
elif isinstance(obj, Apply):
rval = list(obj.inputs)
if rval:
if not isinstance(rval, (list, OrderedSet)):
raise TypeError(
"Non-deterministic collections here make"
" toposort non-deterministic.")
deps_cache[obj] = list(rval)
else:
deps_cache[obj] = rval
else:
deps_cache[obj] = rval
rval = obj.inputs
deps_cache[obj] = rval
return rval
else:
def compute_deps(obj):
rval = []
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论