提交 61794531 authored 作者: Tanjay94's avatar Tanjay94

Minified linalg ops to fit this PR and changed str to print all the properties.

上级 69307dda
......@@ -586,7 +586,7 @@ class Op(utils.object2, PureOp, CLinkerOp):
def __str__(self):
if hasattr(self, '__props__'):
return "%s{%s}" % (self.__class__.__name__, ", ".join(str(p) for p in self._props()))
return "%s{%s}" % (self.__class__.__name__, ", ".join("%s=%r" % (p, getattr(self, p)) for p in self.__props__))
else:
return super(Op, self).__str__()
......
......@@ -70,16 +70,13 @@ class Hint(Op):
transfer that information out of the graph.
"""
__props__ = ('hints', 'view_map')
def __init__(self, **kwargs):
self.hints = tuple(kwargs.items())
self.view_map = {0: [0]}
def __eq__(self, other):
return type(self) == type(other) and self.hints == other.hints
def __hash__(self):
return hash((type(self), self.hints))
def make_node(self, x):
return Apply(self, [x], [x.type()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论