提交 f557b0c4 编写于 作者: C chengduoZH

fix data_layer for 3D data

上级 43da7675
...@@ -929,11 +929,13 @@ def data_layer(name, size, depth=None, height=None, width=None, ...@@ -929,11 +929,13 @@ def data_layer(name, size, depth=None, height=None, width=None,
width=width, width=width,
**ExtraLayerAttribute.to_kwargs(layer_attr)) **ExtraLayerAttribute.to_kwargs(layer_attr))
if depth is None:
depth = 1
num_filters = None num_filters = None
if height is not None and width is not None: if height is not None and width is not None:
num_filters = size / (width * height) num_filters = size / (width * height * depth)
assert num_filters * width * height == size, \ assert num_filters * width * height * depth == size, \
"size=%s width=%s height=%s" % (size, width, height) "size=%s width=%s height=%s depth=%s" % (size, width, height, depth)
return LayerOutput(name, LayerType.DATA, size=size, num_filters=num_filters) return LayerOutput(name, LayerType.DATA, size=size, num_filters=num_filters)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册