提交 576c75d6 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

__props__ for theano/tensor/blas.py

上级 b8775273
...@@ -360,23 +360,19 @@ class Gemv(Op): ...@@ -360,23 +360,19 @@ class Gemv(Op):
alpha, beta are scalars alpha, beta are scalars
output is a vector that can be inplace on y output is a vector that can be inplace on y
""" """
__props__ = ("inplace",)
def __init__(self, inplace): def __init__(self, inplace):
self.inplace = inplace self.inplace = inplace
if inplace: if inplace:
self.destroy_map = {0: [0]} self.destroy_map = {0: [0]}
def __eq__(self, other):
return type(self) == type(other) and self.inplace == other.inplace
def __str__(self): def __str__(self):
if self.inplace: if self.inplace:
return '%s{inplace}' % self.__class__.__name__ return '%s{inplace}' % self.__class__.__name__
else: else:
return '%s{no_inplace}' % self.__class__.__name__ return '%s{no_inplace}' % self.__class__.__name__
def __hash__(self):
return hash(type(self)) ^ hash(self.inplace)
def make_node(self, y, alpha, A, x, beta): def make_node(self, y, alpha, A, x, beta):
y = T.as_tensor_variable(y) y = T.as_tensor_variable(y)
x = T.as_tensor_variable(x) x = T.as_tensor_variable(x)
...@@ -453,18 +449,13 @@ class Ger(Op): ...@@ -453,18 +449,13 @@ class Ger(Op):
:TODO: Create better classes ScipyGer and CGer that inherit from this class :TODO: Create better classes ScipyGer and CGer that inherit from this class
and override the make_thunk() method to use Scipy and C respectively. and override the make_thunk() method to use Scipy and C respectively.
""" """
__props__ = ("destructive",)
def __init__(self, destructive): def __init__(self, destructive):
self.destructive = destructive self.destructive = destructive
if destructive: if destructive:
self.destroy_map = {0: [0]} self.destroy_map = {0: [0]}
def __eq__(self, other):
return (type(self) == type(other) and
self.destructive == other.destructive)
def __hash__(self):
return hash(type(self)) ^ hash(self.destructive)
def __str__(self): def __str__(self):
if self.destructive: if self.destructive:
return '%s{destructive}' % self.__class__.__name__ return '%s{destructive}' % self.__class__.__name__
...@@ -611,14 +602,7 @@ class GemmRelated(Op): ...@@ -611,14 +602,7 @@ class GemmRelated(Op):
This class provides a kind of templated gemm Op. This class provides a kind of templated gemm Op.
""" """
def __eq__(self, other): __props__ = ()
return (type(self) == type(other))
def __hash__(self):
return hash(type(self))
def __str__(self):
return self.__class__.__name__
def c_support_code(self): def c_support_code(self):
# return cblas_header_text() # return cblas_header_text()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论