未验证 提交 dbfc76ab 编写于 作者: G Guo Sheng 提交者: GitHub

Merge pull request #5927 from guoshengCS/fix-addtolayer-check

Fix the check in addto_layer
...@@ -2798,19 +2798,18 @@ class AddToLayer(LayerBase): ...@@ -2798,19 +2798,18 @@ class AddToLayer(LayerBase):
name, self.layer_type, 0, inputs=inputs, **xargs) name, self.layer_type, 0, inputs=inputs, **xargs)
config_assert(len(inputs) > 0, 'inputs cannot be empty for AddToLayer') config_assert(len(inputs) > 0, 'inputs cannot be empty for AddToLayer')
if len(self.inputs) > 1: layer_size = self.get_input_layer(0).size
for input_index in xrange(len(self.inputs)): # To reserve heght, width, depth.
assert self.get_input_layer(0).height == self.get_input_layer( layer_with_hwc = self.get_input_layer(0)
input_index).height for input_index in xrange(len(self.inputs)):
assert self.get_input_layer(0).width == self.get_input_layer( input_layer = self.get_input_layer(input_index)
input_index).width assert layer_size == input_layer.size
assert self.get_input_layer(0).depth == self.get_input_layer( if input_layer.height and input_layer.height and input_layer.height:
input_index).depth layer_with_hwc = input_layer
self.set_layer_size(self.get_input_layer(0).size) self.set_layer_size(layer_with_hwc.size)
self.set_layer_height_width(self.get_input_layer(0).height, \ self.set_layer_height_width(layer_with_hwc.height, layer_with_hwc.width)
self.get_input_layer(0).width) self.set_layer_depth(layer_with_hwc.depth)
self.set_layer_depth(self.get_input_layer(0).depth)
self.create_bias_parameter(bias, self.config.size) self.create_bias_parameter(bias, self.config.size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册