提交 2db3760d authored 作者: Ricardo Vieira's avatar Ricardo Vieira 提交者: Michael Osthege

Don't change constant names in FunctionGraph features

上级 f4536c30
......@@ -753,7 +753,8 @@ class PreserveVariableAttributes(Feature):
"""
def on_change_input(self, fgraph, node, i, r, new_r, reason=None):
if r.name is not None and new_r.name is None:
# Don't change the name of constants
if r.owner and r.name is not None and new_r.name is None:
new_r.name = r.name
if (
getattr(r.tag, "nan_guard_mode_check", False)
......
......@@ -588,10 +588,6 @@ class MergeFeature(Feature):
sig = c.merge_signature()
other_c = self.atomic_sig_inv.get(sig, None)
if other_c is not None:
# multiple names will clobber each other..
# we adopt convention to keep the last name
if c.name:
other_c.name = c.name
self.scheduled.append([[(c, other_c, "merge")]])
else:
# this is a new constant
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论