提交 cf2b6b23 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

__props__ for theano/tensor/extra_ops.py

上级 dc01863f
...@@ -65,6 +65,7 @@ cpu_contiguous = CpuContiguous() ...@@ -65,6 +65,7 @@ cpu_contiguous = CpuContiguous()
class CumsumOp(theano.Op): class CumsumOp(theano.Op):
# See function cumsum for docstring # See function cumsum for docstring
__props__ = ("axis",) __props__ = ("axis",)
def __init__(self, axis=None): def __init__(self, axis=None):
...@@ -182,6 +183,7 @@ def cumsum(x, axis=None): ...@@ -182,6 +183,7 @@ def cumsum(x, axis=None):
class CumprodOp(theano.Op): class CumprodOp(theano.Op):
# See function cumprod for docstring # See function cumprod for docstring
__props__ = ("axis",) __props__ = ("axis",)
def __init__(self, axis=None): def __init__(self, axis=None):
...@@ -344,9 +346,6 @@ class DiffOp(theano.Op): ...@@ -344,9 +346,6 @@ class DiffOp(theano.Op):
out_shape[self.axis] = out_shape[self.axis] - self.n out_shape[self.axis] = out_shape[self.axis] - self.n
return [out_shape] return [out_shape]
def __str__(self):
return self.__class__.__name__
def diff(x, n=1, axis=-1): def diff(x, n=1, axis=-1):
"""Calculate the n-th order discrete difference along given axis. """Calculate the n-th order discrete difference along given axis.
...@@ -462,9 +461,6 @@ class BinCountOp(theano.Op): ...@@ -462,9 +461,6 @@ class BinCountOp(theano.Op):
m = basic.maximum(m, self.minlength) m = basic.maximum(m, self.minlength)
return [[m]] return [[m]]
def __str__(self):
return self.__class__.__name__
def bincount(x, weights=None, minlength=None, assert_nonneg=False): def bincount(x, weights=None, minlength=None, assert_nonneg=False):
"""Count number of occurrences of each value in array of ints. """Count number of occurrences of each value in array of ints.
...@@ -566,6 +562,8 @@ class RepeatOp(theano.Op): ...@@ -566,6 +562,8 @@ class RepeatOp(theano.Op):
# See the repeat function for docstring # See the repeat function for docstring
__props__ = ("axis",) __props__ = ("axis",)
__props__ = ()
def __init__(self, axis=None): def __init__(self, axis=None):
self.axis = axis self.axis = axis
...@@ -670,9 +668,6 @@ class RepeatOp(theano.Op): ...@@ -670,9 +668,6 @@ class RepeatOp(theano.Op):
out_shape[self.axis] = theano.tensor.sum(repeats, dtype=dtype) out_shape[self.axis] = theano.tensor.sum(repeats, dtype=dtype)
return [out_shape] return [out_shape]
def __str__(self):
return self.__class__.__name__
def repeat(x, repeats, axis=None): def repeat(x, repeats, axis=None):
"""Repeat elements of an array. """Repeat elements of an array.
...@@ -739,9 +734,6 @@ class Bartlett(gof.Op): ...@@ -739,9 +734,6 @@ class Bartlett(gof.Op):
# See function bartlett for docstring # See function bartlett for docstring
__props__ = () __props__ = ()
def __str__(self):
return self.__class__.__name__
def make_node(self, M): def make_node(self, M):
M = tensor.as_tensor_variable(M) M = tensor.as_tensor_variable(M)
if M.ndim != 0: if M.ndim != 0:
...@@ -797,9 +789,6 @@ class FillDiagonal(gof.Op): ...@@ -797,9 +789,6 @@ class FillDiagonal(gof.Op):
# See function fill_diagonal for docstring # See function fill_diagonal for docstring
__props__ = () __props__ = ()
def __str__(self):
return self.__class__.__name__
def infer_shape(self, node, in_shapes): def infer_shape(self, node, in_shapes):
return [in_shapes[0]] return [in_shapes[0]]
...@@ -881,9 +870,6 @@ class FillDiagonalOffset(gof.Op): ...@@ -881,9 +870,6 @@ class FillDiagonalOffset(gof.Op):
# See function fill_diagonal_offset for docstring # See function fill_diagonal_offset for docstring
__props__ = () __props__ = ()
def __str__(self):
return self.__class__.__name__
def infer_shape(self, node, in_shapes): def infer_shape(self, node, in_shapes):
return [in_shapes[0]] return [in_shapes[0]]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论