提交 3ff56c1d authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: sentient07

Get the shape of the node closer to inputs.

上级 c16c66eb
...@@ -952,8 +952,6 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1), ...@@ -952,8 +952,6 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
# Standard case: We use GpuDnnConv with suitable padding. # Standard case: We use GpuDnnConv with suitable padding.
# contig_version will return a gpu_contiguous copy # contig_version will return a gpu_contiguous copy
# if the img contains negative strides # if the img contains negative strides
img = gpu_contiguous(img)
kerns = gpu_contiguous(kerns)
desc = GpuDnnConvDesc(border_mode=border_mode, subsample=subsample, desc = GpuDnnConvDesc(border_mode=border_mode, subsample=subsample,
conv_mode=conv_mode, precision=precision)(kerns.shape) conv_mode=conv_mode, precision=precision)(kerns.shape)
desc_op = desc.owner.op desc_op = desc.owner.op
...@@ -961,6 +959,8 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1), ...@@ -961,6 +959,8 @@ def dnn_conv(img, kerns, border_mode='valid', subsample=(1, 1),
desc_op.border_mode, desc_op.border_mode,
desc_op.subsample) desc_op.subsample)
out = gpu_alloc_empty(img.dtype, ctx_name)(*out_shp) out = gpu_alloc_empty(img.dtype, ctx_name)(*out_shp)
img = gpu_contiguous(img)
kerns = gpu_contiguous(kerns)
return gpu_dnn_conv(algo=algo)(img, kerns, out, desc) return gpu_dnn_conv(algo=algo)(img, kerns, out, desc)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论