提交 5047b874 authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: sentient07

Build smaller conv shape graph.

上级 0691fb01
...@@ -121,7 +121,16 @@ def get_conv_shape_1axis(image_shape, kernel_shape, border_mode, ...@@ -121,7 +121,16 @@ def get_conv_shape_1axis(image_shape, kernel_shape, border_mode,
pad = border_mode pad = border_mode
if pad < 0: if pad < 0:
raise ValueError("border_mode must be >= 0") raise ValueError("border_mode must be >= 0")
out_shp = (image_shape + 2 * pad - dil_kernel_shape) // subsample + 1
# In case of symbolic shape, we want to build the smallest graph
# (image_shape + 2 * pad - dil_kernel_shape) // subsample + 1
if pad == 0:
out_shp = (image_shape - dil_kernel_shape)
else:
out_shp = (image_shape + 2 * pad - dil_kernel_shape)
if subsample != 1:
out_shp = out_shp // subsample
out_shp = out_shp + 1
return out_shp return out_shp
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论