提交 7f0e884d authored 作者: Frederic's avatar Frederic

make the check work with iterator (so with OrderedDict).

Should solve travis-ci tests in this PR.
上级 7eb745d8
......@@ -438,7 +438,8 @@ def pfunc(params, outputs=None, mode=None, updates=None, givens=None,
and not isinstance(no_default_updates, list):
raise TypeError("no_default_update should be either a boolean or a list")
if len(updates) > 0 and isinstance(iter_over_pairs(updates)[0], Variable):
if len(updates) > 0 and any(isinstance(v, Variable)
for v in iter_over_pairs(updates)):
raise ValueError(
"The updates parameter must an OrderedDict/dict or a list of list/tuple with 2 elements")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论