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

clean up.

上级 f5b24c1a
...@@ -3478,7 +3478,7 @@ class Composite(ScalarOp): ...@@ -3478,7 +3478,7 @@ class Composite(ScalarOp):
if name: if name:
out.name = name out.name = name
else: else:
name = getattr(out, 'name', None) name = out.name
super(Composite, out).__init__(output_types_preference, name) super(Composite, out).__init__(output_types_preference, name)
return out return out
...@@ -3561,23 +3561,8 @@ class Composite(ScalarOp): ...@@ -3561,23 +3561,8 @@ class Composite(ScalarOp):
Return a readable string representation of self.fgraph. Return a readable string representation of self.fgraph.
""" """
try:
rval = self.name rval = self.name
if rval is None: if rval is None:
raise AttributeError
except AttributeError:
if 0:
l = []
for n in self.fgraph.toposort():
if hasattr(n.op, "name") and n.op.name is not None:
v = n.op.name
if v.startswith("Composite"):
v = v[len("Composite"):]
else:
v = n.op.__class__.__name__
l.append(v)
rval = "Composite{" + ",".join(l) + "}"
else:
for i, r in enumerate(self.fgraph.inputs): for i, r in enumerate(self.fgraph.inputs):
r.name = 'i%i' % i r.name = 'i%i' % i
for i, r in enumerate(self.fgraph.outputs): for i, r in enumerate(self.fgraph.outputs):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论