提交 92372b77 authored 作者: Marc-Alexandre Cote's avatar Marc-Alexandre Cote

Replaced __eq__(), __hash__() and __str__() by using __props__ instead

上级 4b1eb7ae
...@@ -15,21 +15,7 @@ if cuda_available: ...@@ -15,21 +15,7 @@ if cuda_available:
class GpuCumsum(CumsumOp, GpuOp): class GpuCumsum(CumsumOp, GpuOp):
SUPPORTED_NDIMS = 2 SUPPORTED_NDIMS = 2
__props__ = ('axis', 'max_threads_dim0', 'max_grid_size1')
def __eq__(self, other):
return type(self) == type(other) \
and self.axis == other.axis \
and self.max_threads_dim0 == other.max_threads_dim0 \
and self.max_grid_size1 == other.max_grid_size1
def __hash__(self):
return hash(type(self)) \
^ hash(self.axis) \
^ hash(self.max_threads_dim0) \
^ hash(self.max_grid_size1)
def __str__(self):
return "%s{%s}" % (self.__class__.__name__, self.axis)
def __init__(self, axis): def __init__(self, axis):
""" """
...@@ -78,7 +64,7 @@ class GpuCumsum(CumsumOp, GpuOp): ...@@ -78,7 +64,7 @@ class GpuCumsum(CumsumOp, GpuOp):
compute_map, no_recycling) compute_map, no_recycling)
def c_code_cache_version(self): def c_code_cache_version(self):
return (5,) return (6,)
def c_support_code_apply(self, node, nodename): def c_support_code_apply(self, node, nodename):
return """ return """
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论