提交 4725eb99 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

fix for when replace is a list or None

上级 ded724a9
...@@ -169,7 +169,12 @@ def clone(output, ...@@ -169,7 +169,12 @@ def clone(output,
shared variables still use the same underlying storage, so they shared variables still use the same underlying storage, so they
will always have the same value. will always have the same value.
""" """
items = replace.items() if isinstance(replace, dict):
items = replace.items()
elif isinstance(replace, list):
items = replace
else:
items = []
tmp_replace = [(x, x.type()) for x, y in items] tmp_replace = [(x, x.type()) for x, y in items]
new_replace = [(x, y) for ((_, x), (_, y)) in zip(tmp_replace, new_replace = [(x, y) for ((_, x), (_, y)) in zip(tmp_replace,
items)] items)]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论