提交 95f00390 authored 作者: Frederic Bastien's avatar Frederic Bastien

Make a_theano_function.get_shared() that return shared variables.

上级 b524724d
...@@ -967,9 +967,14 @@ class Function(object): ...@@ -967,9 +967,14 @@ class Function(object):
for node in self.nodes_with_inner_function: for node in self.nodes_with_inner_function:
ops_with_inner_function[node.op].free() ops_with_inner_function[node.op].free()
def get_shared(self):
"""
Return the shared variable read or updated by by this function.
"""
return [i.variable for i in self.maker.inputs if i.implicit]
# pickling/deepcopy support for Function
# pickling/deepcopy support for Function
def _pickle_Function(f): def _pickle_Function(f):
# copy of the input storage list # copy of the input storage list
ins = list(f.input_storage) ins = list(f.input_storage)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论