提交 0e59cb90 authored 作者: James Bergstra's avatar James Bergstra

added type check to TensorConstantSignature __eq__

上级 522f80a3
...@@ -801,6 +801,8 @@ class TensorConstantSignature(tuple): ...@@ -801,6 +801,8 @@ class TensorConstantSignature(tuple):
An instance is a pair: (Type instance, ndarray). An instance is a pair: (Type instance, ndarray).
""" """
def __eq__(self, other): def __eq__(self, other):
if type(self) != type(other):
return False
try: try:
(t0, d0), (t1,d1) = self, other (t0, d0), (t1,d1) = self, other
except: except:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论