提交 3a9c6df8 authored 作者: Frederic Bastien's avatar Frederic Bastien

merge the new Scan change in the trunk.

上级 c3c5d8a9
......@@ -69,8 +69,8 @@ FancyModule = Module
from printing import \
pprint, pp
import scan as scan_module
from scan import scan, map, reduce, foldl, foldr, Scan, ScanGrad
import scan_module
from scan_module import scan, map, reduce, foldl, foldr, clone
import tensor
import scalar
......
......@@ -38,6 +38,9 @@ def alias_root(v):
def view_tree_set(v, treeset):
"""Add to `treeset` all variables that are views of v, given that v is not a view"""
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:
if cl == 'output':
continue
......
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论