提交 e9697dc4 authored 作者: Valentin Bisson's avatar Valentin Bisson

Implemented __hash__ and __str__ for Remove0 operator.

上级 5f46bbcf
......@@ -231,6 +231,15 @@ class Remove0(Op):
def __eq__(self,other):
return type(self) == type(other) and self.inplace == other.inplace
def __hash__(self):
return 64153 ^ hash(type(self)) ^ hash(self.inplace)
def __str__(self):
s = self.__class__.__name__
if self.inplace:
s += '{inplace}'
return s
def make_node(self, x):
return gof.Apply(self, [x], [x.type()])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论