提交 08c4a8fd authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Fix problem with border_mode = <int>

上级 c1209105
...@@ -692,14 +692,16 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1), ...@@ -692,14 +692,16 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
kerns = gpu_contiguous(kerns) kerns = gpu_contiguous(kerns)
desc = GpuDnnConvDesc(border_mode=border_mode, subsample=subsample, desc = GpuDnnConvDesc(border_mode=border_mode, subsample=subsample,
conv_mode=conv_mode)(img.shape, kerns.shape) conv_mode=conv_mode)(img.shape, kerns.shape)
desc_op = desc.owner.op
if conv_mode == 'cross' and subsample != (1, 1) and border_mode != 'valid': if conv_mode == 'cross' and subsample != (1, 1) and border_mode != 'valid':
# there is a bug in cudnn v2 rc1-3 which gives incorrect # there is a bug in cudnn v2 rc1-3 which gives incorrect
# results in this case when using the workmem='small' # results in this case when using the workmem='small'
# algorithm. # algorithm.
if workmem is None or workmem == 'small': if workmem is None or workmem == 'small':
workmem = 'none' workmem = 'none'
out_shp = GpuDnnConv.get_out_shape(img.shape, kerns.shape, border_mode, out_shp = GpuDnnConv.get_out_shape(img.shape, kerns.shape,
subsample) desc_op.border_mode,
desc_op.subsample)
out = gpu_alloc(_zero.clone(), out = gpu_alloc(_zero.clone(),
out_shp[0], out_shp[1], out_shp[0], out_shp[1],
out_shp[2], out_shp[3]) out_shp[2], out_shp[3])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论