提交 0a5ec006 authored 作者: James Bergstra's avatar James Bergstra

Renamed view_map_root -> alias_root. the new name is more accurate.

上级 653a44aa
...@@ -20,8 +20,8 @@ from io import * ...@@ -20,8 +20,8 @@ from io import *
import logging import logging
_logger = logging.getLogger('theano.compile.function_module') _logger = logging.getLogger('theano.compile.function_module')
def view_map_root(v): def alias_root(v):
"""Return the variable that v is ultimately a view of""" """Return the variable to which v is aliased by view_maps and destroy_maps"""
if v.owner is None: return v if v.owner is None: return v
vmap = getattr(v.owner.op, 'view_map', {}) vmap = getattr(v.owner.op, 'view_map', {})
dmap = getattr(v.owner.op, 'destroy_map', {}) dmap = getattr(v.owner.op, 'destroy_map', {})
...@@ -30,7 +30,7 @@ def view_map_root(v): ...@@ -30,7 +30,7 @@ def view_map_root(v):
if len(v_views) > 1: if len(v_views) > 1:
raise NotImplementedError() raise NotImplementedError()
elif v_views: elif v_views:
return view_map_root(v.owner.inputs[v_views[0]]) return alias_root(v.owner.inputs[v_views[0]])
else: else:
return v return v
...@@ -57,7 +57,7 @@ def infer_reuse_pattern(env, outputs_to_disown): ...@@ -57,7 +57,7 @@ def infer_reuse_pattern(env, outputs_to_disown):
""" """
rval = set() rval = set()
for o in outputs_to_disown: for o in outputs_to_disown:
view_tree_set(view_map_root(o), rval) view_tree_set(alias_root(o), rval)
# remove from rval all of the inputs, constants, values. # remove from rval all of the inputs, constants, values.
rval = set(r for r in rval if r.owner is not None) rval = set(r for r in rval if r.owner is not None)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论