提交 1a427e83 authored 作者: Frederic Bastien's avatar Frederic Bastien

make the GpuConv differ if we pass different value for version.

上级 3a258042
...@@ -161,7 +161,8 @@ class GpuConv(Op): ...@@ -161,7 +161,8 @@ class GpuConv(Op):
and self.subsample == other.subsample \ and self.subsample == other.subsample \
and self.logical_img_hw == other.logical_img_hw \ and self.logical_img_hw == other.logical_img_hw \
and self.logical_kern_hw == other.logical_kern_hw \ and self.logical_kern_hw == other.logical_kern_hw \
and self.logical_kern_align_top == other.logical_kern_align_top and self.logical_kern_align_top == other.logical_kern_align_top \
and self.version
def __hash__(self): def __hash__(self):
return hash(type(self)) \ return hash(type(self)) \
...@@ -169,8 +170,9 @@ class GpuConv(Op): ...@@ -169,8 +170,9 @@ class GpuConv(Op):
^ hash(self.subsample) \ ^ hash(self.subsample) \
^ hash(self.logical_img_hw) \ ^ hash(self.logical_img_hw) \
^ hash(self.logical_kern_hw) \ ^ hash(self.logical_kern_hw) \
^ hash(self.logical_kern_align_top) ^ hash(self.logical_kern_align_top) \
^ hash(self.version)
def __str__(self): def __str__(self):
return '%s{%s, %s, %s, %s, %s}' %(self.__class__.__name__, return '%s{%s, %s, %s, %s, %s}' %(self.__class__.__name__,
self.border_mode, self.border_mode,
...@@ -198,7 +200,7 @@ class GpuConv(Op): ...@@ -198,7 +200,7 @@ class GpuConv(Op):
return ['cuda_ndarray.cuh','<stdio.h>'] return ['cuda_ndarray.cuh','<stdio.h>']
def c_code_cache_version(self): def c_code_cache_version(self):
return (0,3) return (0,4)
def c_support_code_apply(self, node, nodename): def c_support_code_apply(self, node, nodename):
return open(os.path.join(os.path.split(__file__)[0],'conv_kernel.cu')).read()+\ return open(os.path.join(os.path.split(__file__)[0],'conv_kernel.cu')).read()+\
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论