提交 53b938d0 authored 作者: Tanjay94's avatar Tanjay94

Fixed small mistakes in code.

上级 73daa003
...@@ -587,7 +587,7 @@ class Op(utils.object2, PureOp, CLinkerOp): ...@@ -587,7 +587,7 @@ class Op(utils.object2, PureOp, CLinkerOp):
def __str__(self): def __str__(self):
if hasattr(self, '__props__'): if hasattr(self, '__props__'):
if len(self.__props__) == 0: if len(self.__props__) == 0:
return "%s" % (self.__class__.__name__, ", ".join("%s=%r")) return "%s" % (self.__class__.__name__,)
else: else:
return "%s{%s}" % (self.__class__.__name__, ", ".join("%s=%r" % (p, getattr(self, p)) for p in self.__props__)) return "%s{%s}" % (self.__class__.__name__, ", ".join("%s=%r" % (p, getattr(self, p)) for p in self.__props__))
else: else:
......
...@@ -71,7 +71,7 @@ class Hint(Op): ...@@ -71,7 +71,7 @@ class Hint(Op):
""" """
__props__ = ('hints', 'view_map') __props__ = ('hints',)
def __init__(self, **kwargs): def __init__(self, **kwargs):
self.hints = tuple(kwargs.items()) self.hints = tuple(kwargs.items())
......
...@@ -31,6 +31,9 @@ class MatrixPinv(Op): ...@@ -31,6 +31,9 @@ class MatrixPinv(Op):
exact and faster to compute. Also this op does not get optimized into a exact and faster to compute. Also this op does not get optimized into a
solve op. solve op.
""" """
__props__ = ()
def __init__(self): def __init__(self):
pass pass
...@@ -56,6 +59,8 @@ class MatrixInverse(Op): ...@@ -56,6 +59,8 @@ class MatrixInverse(Op):
of ``solve``. of ``solve``.
""" """
__props__ = ()
def __init__(self): def __init__(self):
pass pass
...@@ -281,6 +286,7 @@ class Eig(Op): ...@@ -281,6 +286,7 @@ class Eig(Op):
""" """
_numop = staticmethod(numpy.linalg.eig) _numop = staticmethod(numpy.linalg.eig)
__props__ = ()
def make_node(self, x): def make_node(self, x):
x = as_tensor_variable(x) x = as_tensor_variable(x)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论