提交 09e6fafe authored 作者: Frederic's avatar Frederic

Fix test in DebugMode. The test op inherit from a class that implement the…

Fix test in DebugMode. The test op inherit from a class that implement the __eq__ and __hash__ and those implementation was wrong.
上级 0da475cd
......@@ -1124,6 +1124,12 @@ class TimesN(theano.scalar.basic.UnaryScalarOp):
Must be outside of the class, otherwise, the c cache code can't
pickle this class and this cause stuff printing during test.
"""
def __eq__(self, other):
return super(TimesN, self).__eq__(other) and self.n == other.n
def __hash__(self):
return super(TimesN, self).__hash__() ^ hash(self.n)
def __init__(self, n, *args, **kwargs):
self.n = n
theano.scalar.basic.UnaryScalarOp.__init__(self, *args, **kwargs)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论