提交 cda3bde3 authored 作者: Frederic Bastien's avatar Frederic Bastien

added scalar.Composite.__str__ as we don't want all element of the op to happear…

added scalar.Composite.__str__ as we don't want all element of the op to happear in the str representation.
上级 dc3ae8c6
......@@ -1176,6 +1176,14 @@ class Composite(ScalarOp):
implement the loop fusion optimizer (which I have yet to do
someday...)
"""
def __str__(self):
if hasattr(self, 'name') and self.name:
return self.name
else:
return "%s{%s}" % (self.__class__.__name__, ", ".join(
"%s=%s" % (k, v) for k, v in self.__dict__.items()
if k not in ["name","env","_c_code"] ))
def __init__(self, inputs, outputs):
env = Env(*gof.graph.clone(inputs, outputs))
gof.MergeOptimizer().optimize(env)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论