提交 0cbbd630 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

Added __props__ in class TrueDot

上级 b82123d4
...@@ -3047,18 +3047,14 @@ class TrueDot(gof.op.Op): ...@@ -3047,18 +3047,14 @@ class TrueDot(gof.op.Op):
# TODO # TODO
# Simplify code by splitting into DotSS and DotSD. # Simplify code by splitting into DotSS and DotSD.
def __init__(self, grad_preserves_dense=True): __props__ = ()
self.grad_preserves_dense = grad_preserves_dense
def __eq__(self, other):
# The grad_preserves_dense attribute doesn't change the # The grad_preserves_dense attribute doesn't change the
# execution behavior. To let the optimizer merge nodes with # execution behavior. To let the optimizer merge nodes with
# different values of this attribute we shouldn't compare it # different values of this attribute we shouldn't compare it
# here. # here.
return type(self) == type(other)
def __hash__(self): def __init__(self, grad_preserves_dense=True):
return hash(type(self)) self.grad_preserves_dense = grad_preserves_dense
def __ne__(self, other): def __ne__(self, other):
return not (self == other) return not (self == other)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论