提交 2eb732ed authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Merge pull request #3141 from harlouci/props_corrige2

Props corrige2
......@@ -64,16 +64,11 @@ cpu_contiguous = CpuContiguous()
class CumsumOp(theano.Op):
# See function cumsum for docstring
__props__ = ("axis",)
def __init__(self, axis=None):
self.axis = axis
def __eq__(self, other):
return (type(self) == type(other) and
self.axis == other.axis)
def __hash__(self):
return hash(type(self)) ^ hash(self.axis)
def make_node(self, x):
x = basic.as_tensor_variable(x)
out_type = x.type()
......@@ -186,16 +181,11 @@ def cumsum(x, axis=None):
class CumprodOp(theano.Op):
# See function cumprod for docstring
__props__ = ("axis",)
def __init__(self, axis=None):
self.axis = axis
def __eq__(self, other):
return (type(self) == type(other) and
self.axis == other.axis)
def __hash__(self):
return hash(type(self)) ^ hash(self.axis)
def make_node(self, x):
x = basic.as_tensor_variable(x)
out_type = x.type()
......@@ -310,6 +300,8 @@ def cumprod(x, axis=None):
class DiffOp(theano.Op):
# See function diff for docstring
__props__ = ("n", "axis")
def __init__(self, n=1, axis=-1):
self.n = n
self.axis = axis
......@@ -318,14 +310,6 @@ class DiffOp(theano.Op):
if n == 0:
self.view_map = {0: [0]}
def __eq__(self, other):
return (type(self) == type(other) and
self.n == other.n and
self.axis == other.axis)
def __hash__(self):
return hash(type(self)) ^ hash(self.n) ^ hash(self.axis)
def make_node(self, x):
x = basic.as_tensor_variable(x)
return theano.Apply(self, [x], [x.type()])
......@@ -391,6 +375,7 @@ class BinCountOp(theano.Op):
compatible_type = ('int8', 'int16', 'int32', 'int64',
'uint8', 'uint16', 'uint32', 'uint64')
"""Tuple of all compatible dtype for the parameter of this op."""
__props__ = ("minlength",)
def __init__(self, minlength=None):
self.minlength = minlength
......@@ -401,13 +386,6 @@ class BinCountOp(theano.Op):
"BinCountOp with minlength attribute"
" requires NumPy 1.6 or higher.")
def __eq__(self, other):
return (type(self) == type(other) and
self.minlength == other.minlength)
def __hash__(self):
return hash(type(self)) ^ hash(self.minlength)
def make_node(self, x, weights):
warnings.warn((
"Tile op is deprecated, use tile function instead."),
......@@ -585,17 +563,11 @@ def compress(condition, x, axis=None):
class RepeatOp(theano.Op):
# See the repeat function for docstring
__props__ = ("axis",)
def __init__(self, axis=None):
self.axis = axis
def __eq__(self, other):
return (type(self) == type(other) and
self.axis == other.axis)
def __hash__(self):
return hash(type(self)) ^ hash(self.axis)
def make_node(self, x, repeats):
x = basic.as_tensor_variable(x)
repeats = basic.as_tensor_variable(repeats)
......@@ -764,11 +736,7 @@ def repeat(x, repeats, axis=None):
class Bartlett(gof.Op):
# See function bartlett for docstring
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
__props__ = ()
def __str__(self):
return self.__class__.__name__
......@@ -826,11 +794,7 @@ def bartlett(M):
class FillDiagonal(gof.Op):
# See function fill_diagonal for docstring
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
__props__ = ()
def __str__(self):
return self.__class__.__name__
......@@ -914,11 +878,7 @@ def fill_diagonal(a, val):
class FillDiagonalOffset(gof.Op):
# See function fill_diagonal_offset for docstring
def __eq__(self, other):
return type(self) == type(other)
def __hash__(self):
return hash(type(self))
__props__ = ()
def __str__(self):
return self.__class__.__name__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论