提交 1367e77d authored 作者: Iban Harlouchet's avatar Iban Harlouchet

Synchronised with doc/extending/*.txt

上级 b58b7cc3
...@@ -308,6 +308,8 @@ version that it produces in the code I gave above. ...@@ -308,6 +308,8 @@ version that it produces in the code I gave above.
class BinaryDoubleOp(gof.Op): class BinaryDoubleOp(gof.Op):
__props__ = ("name", "fn", "ccode")
def __init__(self, name, fn, ccode): def __init__(self, name, fn, ccode):
self.name = name self.name = name
self.fn = fn self.fn = fn
......
...@@ -35,12 +35,7 @@ you should check the strides and alignment. ...@@ -35,12 +35,7 @@ you should check the strides and alignment.
""" """
An arbitrarily generalized Fibbonacci sequence An arbitrarily generalized Fibbonacci sequence
""" """
__props__ = ()
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
def make_node(self, x): def make_node(self, x):
x_ = tensor.as_tensor_variable(x) x_ = tensor.as_tensor_variable(x)
......
...@@ -682,16 +682,12 @@ arithmetic operators: ...@@ -682,16 +682,12 @@ arithmetic operators:
class BinaryDoubleOp(gof.Op): class BinaryDoubleOp(gof.Op):
__props__ = ("name", "fn")
def __init__(self, name, fn): def __init__(self, name, fn):
self.name = name self.name = name
self.fn = fn self.fn = fn
def __eq__(self, other):
return type(self) == type(other) and (self.name == other.name) and (self.fn == other.fn)
def __hash__(self):
return hash(type(self)) ^ hash(self.name) ^ hash(self.fn)
def make_node(self, x, y): def make_node(self, x, y):
if isinstance(x, (int, float)): if isinstance(x, (int, float)):
x = gof.Constant(double, x) x = gof.Constant(double, x)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论