提交 b3aa3073 authored 作者: James Bergstra's avatar James Bergstra 提交者: Frederic

Gemv - new `__repr__` and better `__str__`

上级 08ca46e2
...@@ -173,11 +173,14 @@ class Gemv(Op): ...@@ -173,11 +173,14 @@ class Gemv(Op):
def __eq__(self, other): def __eq__(self, other):
return type(self)==type(other) and self.inplace == other.inplace return type(self)==type(other) and self.inplace == other.inplace
def __repr__(self):
return self.__str__()
def __str__(self): def __str__(self):
if self.inplace: if self.inplace:
return 'Gemv{inplace}' return '%s{inplace}' % self.__class__.__name__
else: else:
return 'Gemv{no_inplace}' return '%s{no_inplace}' % self.__class__.__name__
def __hash__(self): def __hash__(self):
return hash(type(self)) ^ hash(self.inplace) return hash(type(self)) ^ hash(self.inplace)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论