提交 f04672b4 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #4253 from lamblin/fix_debugmode_dnn

Fix tests in DebugMode with DNN convolutions
...@@ -158,9 +158,16 @@ class GpuDnnConvDesc(GpuOp): ...@@ -158,9 +158,16 @@ class GpuDnnConvDesc(GpuOp):
if kern_shape.type.ndim != 1 or kern_shape.type.dtype != 'int64': if kern_shape.type.ndim != 1 or kern_shape.type.dtype != 'int64':
raise TypeError('kern must be 1D shape tensor') raise TypeError('kern must be 1D shape tensor')
return Apply(self, [img_shape, kern_shape], node = Apply(self, [img_shape, kern_shape],
[CDataType("cudnnConvolutionDescriptor_t", [CDataType("cudnnConvolutionDescriptor_t",
freefunc="cudnnDestroyConvolutionDescriptor")()]) freefunc="cudnnDestroyConvolutionDescriptor")()])
# DebugMode cannot compare the values of CDataType variables, so by
# default it returns False all the time. To prevent DebugMode from
# complaining because of the MergeOptimizer, we make this variable
# always compare to True.
out = node.outputs[0]
out.tag.values_eq_approx = tensor.type.values_eq_approx_always_true
return node
def c_code(self, node, name, inputs, outputs, sub): def c_code(self, node, name, inputs, outputs, sub):
img_shape, kern_shape = inputs img_shape, kern_shape = inputs
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论