提交 48661f10 authored 作者: Ramana.S's avatar Ramana.S

Reverted suggested changes

上级 4936e630
...@@ -509,7 +509,7 @@ class FromFunctionOp(gof.Op): ...@@ -509,7 +509,7 @@ class FromFunctionOp(gof.Op):
self.infer_shape = self._infer_shape self.infer_shape = self._infer_shape
def __eq__(self, other): def __eq__(self, other):
return (isinstance(self, type(other)) and return (type(self) == type(other) and
self.__fn == other.__fn) self.__fn == other.__fn)
def __hash__(self): def __hash__(self):
......
...@@ -835,7 +835,7 @@ class Op(utils.object2, PureOp, CLinkerOp): ...@@ -835,7 +835,7 @@ class Op(utils.object2, PureOp, CLinkerOp):
def __eq__(self, other): def __eq__(self, other):
if hasattr(self, '__props__'): if hasattr(self, '__props__'):
return (isinstance(self, type(other)) return (type(self) == type(other)
and self._props() == other._props()) and self._props() == other._props())
else: else:
return NotImplemented return NotImplemented
......
...@@ -29,7 +29,7 @@ class MyType(Type): ...@@ -29,7 +29,7 @@ class MyType(Type):
self.thingy = thingy self.thingy = thingy
def __eq__(self, other): def __eq__(self, other):
return isinstance(other, type(self)) and other.thingy == self.thingy return type(other) == type(self) and other.thingy == self.thingy
def __str__(self): def __str__(self):
return str(self.thingy) return str(self.thingy)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论