提交 9c48e363 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

merge with assembla

...@@ -69,8 +69,8 @@ FancyModule = Module ...@@ -69,8 +69,8 @@ FancyModule = Module
from printing import \ from printing import \
pprint, pp pprint, pp
import scan as scan_module import scan_module
from scan import scan, map, reduce, foldl, foldr, Scan, ScanGrad from scan_module import scan, map, reduce, foldl, foldr, clone
import tensor import tensor
import scalar import scalar
......
...@@ -37,6 +37,9 @@ def alias_root(v): ...@@ -37,6 +37,9 @@ def alias_root(v):
def view_tree_set(v, treeset): def view_tree_set(v, treeset):
"""Add to `treeset` all variables that are views of v, given that v is not a view""" """Add to `treeset` all variables that are views of v, given that v is not a view"""
treeset.add(v) treeset.add(v)
if v.owner and v.owner.op.__class__.__name__ == 'Clone':
v = v.owner.inputs[0]
treeset.add(v)
for cl, v_input_pos_to_cl in v.clients: for cl, v_input_pos_to_cl in v.clients:
if cl == 'output': if cl == 'output':
continue continue
......
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论