提交 64fecf12 authored 作者: Ian Goodfellow's avatar Ian Goodfellow

made pFunc mark which Ins are shared

上级 5254e5fe
......@@ -427,14 +427,18 @@ def pfunc(params, outputs=None, mode=None, updates=[], givens=[],
i.variable = iv
for sv in shared_inputs:
#pass value of None here
#value will be stored in the resulting functions' defaults list
#but since the value of shared variables never needs to be refed, it is not needed
if sv in update_d:
si = In(variable=sv, value=sv.container, mutable=True,
borrow=True, update=update_d[sv])
si = In(variable=sv, value = sv.container, mutable=True,
borrow=True, update=update_d[sv], shared = True)
else:
si = In(variable=sv, value=sv.container,
mutable=False, borrow=True)
si = In(variable=sv, value = sv.container,
mutable=False, borrow=True, shared = True)
inputs.append(si)
return orig_function(inputs, cloned_outputs, mode,
accept_inplace=accept_inplace, name=name, profile=profile)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论