提交 f23fa05b authored 作者: abalkin's avatar abalkin

Issue #783: python3 compatible - refactored any() into a loop to make python 3 happy.

In python 3, list comprehention variables do not leak in the outside scope. In this case the loop is actually cleaner.
上级 0b1778ee
...@@ -179,7 +179,8 @@ def rebuild_collect_shared(outputs, ...@@ -179,7 +179,8 @@ def rebuild_collect_shared(outputs,
# it is also not clear when/how to use the value of that shared # it is also not clear when/how to use the value of that shared
# variable (is it a default? ignored?, if the shared variable changes, # variable (is it a default? ignored?, if the shared variable changes,
# does that function default also change?). # does that function default also change?).
if any([isinstance(v, SharedVariable) for v in input_variables]): for v in input_variables:
if isinstance(v, SharedVariable):
raise TypeError(('Cannot use a shared variable (%s) as explicit ' raise TypeError(('Cannot use a shared variable (%s) as explicit '
'input. Consider substituting a non-shared' 'input. Consider substituting a non-shared'
' variable via the `givens` parameter') % v) ' variable via the `givens` parameter') % v)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论