提交 def199ad authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Add the dnn version to all the CDataTypes based on a dnn type.

上级 921a0df6
...@@ -634,7 +634,7 @@ class _make_cdata(Op): ...@@ -634,7 +634,7 @@ class _make_cdata(Op):
""" % dict(ctype=self.rtype.ctype, out=outputs[0], inp=inputs[0]) """ % dict(ctype=self.rtype.ctype, out=outputs[0], inp=inputs[0])
def c_code_cache_version(self): def c_code_cache_version(self):
return (0,) return (0, self.rtype.version)
class CDataType(Type): class CDataType(Type):
......
...@@ -435,7 +435,8 @@ class GpuDnnConvDesc(COp): ...@@ -435,7 +435,8 @@ class GpuDnnConvDesc(COp):
node = Apply(self, [kern_shape], node = Apply(self, [kern_shape],
[CDataType("cudnnConvolutionDescriptor_t", [CDataType("cudnnConvolutionDescriptor_t",
freefunc="cudnnDestroyConvolutionDescriptor")()]) freefunc="cudnnDestroyConvolutionDescriptor",
version=version(raises=False))()])
# DebugMode cannot compare the values of CDataType variables, so by # DebugMode cannot compare the values of CDataType variables, so by
# default it returns False all the time. To prevent DebugMode from # default it returns False all the time. To prevent DebugMode from
# complaining because of the MergeOptimizer, we make this variable # complaining because of the MergeOptimizer, we make this variable
...@@ -1218,7 +1219,8 @@ class GpuDnnPoolDesc(Op): ...@@ -1218,7 +1219,8 @@ class GpuDnnPoolDesc(Op):
def make_node(self): def make_node(self):
node = Apply(self, [], node = Apply(self, [],
[CDataType("cudnnPoolingDescriptor_t", [CDataType("cudnnPoolingDescriptor_t",
freefunc="cudnnDestroyPoolingDescriptor")()]) freefunc="cudnnDestroyPoolingDescriptor",
version=version(raises=False))()])
# DebugMode cannot compare the values of CDataType variables, so by # DebugMode cannot compare the values of CDataType variables, so by
# default it returns False all the time. To prevent DebugMode from # default it returns False all the time. To prevent DebugMode from
# complaining because of the MergeOptimizer, we make this variable # complaining because of the MergeOptimizer, we make this variable
...@@ -1879,7 +1881,8 @@ class GpuDnnBatchNormGrad(DnnBase): ...@@ -1879,7 +1881,8 @@ class GpuDnnBatchNormGrad(DnnBase):
gpudata_type = CDataType('gpudata *', 'gpudata_release') gpudata_type = CDataType('gpudata *', 'gpudata_release')
dropoutdesc_type = CDataType('cudnnDropoutDescriptor_t', dropoutdesc_type = CDataType('cudnnDropoutDescriptor_t',
'cudnnDestroyDropoutDescriptor') 'cudnnDestroyDropoutDescriptor',
version=version(raises=False))
class GpuDnnDropoutOp(DnnBase): class GpuDnnDropoutOp(DnnBase):
...@@ -1948,7 +1951,8 @@ def dropout(x, dropout=0.0, seed=4242): ...@@ -1948,7 +1951,8 @@ def dropout(x, dropout=0.0, seed=4242):
return y, desc, odesc, states return y, desc, odesc, states
rnndesc_type = CDataType('cudnnRNNDescriptor_t', rnndesc_type = CDataType('cudnnRNNDescriptor_t',
'cudnnDestroyRNNDescriptor') 'cudnnDestroyRNNDescriptor',
version=version(raises=False))
def as_i32(v): def as_i32(v):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论