提交 a1838faa authored 作者: Ian Goodfellow's avatar Ian Goodfellow

changed to using list() to make a copy

上级 383d0cd6
......@@ -309,8 +309,9 @@ def Lop(f, wrt, eval_points, consider_constant=None, warn_type=False,
if not isinstance(f, (list, tuple)):
f = [f]
f = [elem for elem in f]
grads = [elem for elem in eval_points]
#make copies of f and grads so we don't modify the client's copy
f = list(f)
grads = list(eval_points)
for elem in consider_constant:
assert elem not in f
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论