提交 718b1f72 authored 作者: ricardoV94's avatar ricardoV94 提交者: Ricardo Vieira

Don't name constants in inner Composite graph

上级 5b77cfba
...@@ -4246,7 +4246,11 @@ class Composite(ScalarInnerGraphOp): ...@@ -4246,7 +4246,11 @@ class Composite(ScalarInnerGraphOp):
r.name = f"o{int(i)}" r.name = f"o{int(i)}"
io = set(self.fgraph.inputs + self.fgraph.outputs) io = set(self.fgraph.inputs + self.fgraph.outputs)
for i, r in enumerate(self.fgraph.variables): for i, r in enumerate(self.fgraph.variables):
if r not in io and len(self.fgraph.clients[r]) > 1: if (
not isinstance(r, Constant)
and r not in io
and len(self.fgraph.clients[r]) > 1
):
r.name = f"t{int(i)}" r.name = f"t{int(i)}"
if len(self.fgraph.outputs) > 1 or len(self.fgraph.apply_nodes) > 10: if len(self.fgraph.outputs) > 1 or len(self.fgraph.apply_nodes) > 10:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论