提交 a6c53fc2 编写于 作者: W wanghaoshuang

fix python wrapper bugs

上级 e23acb4e
...@@ -3187,8 +3187,8 @@ class SwitchOrderLayer(LayerBase): ...@@ -3187,8 +3187,8 @@ class SwitchOrderLayer(LayerBase):
def __init__(self, name, inputs, reshape, **xargs): def __init__(self, name, inputs, reshape, **xargs):
super(SwitchOrderLayer, self).__init__( super(SwitchOrderLayer, self).__init__(
name, 'switch_order', 0, inputs=inputs, **xargs) name, 'switch_order', 0, inputs=inputs, **xargs)
self.conf.reshape_conf.heightAxis_ = reshape['height'] self.config.reshape_conf.heightAxis.extend(reshape['height'])
self.conf.reshape_conf.widthAxis_ = reshape['width'] self.config.reshape_conf.widthAxis.extend(reshape['width'])
# Deprecated, use a new layer specific class instead # Deprecated, use a new layer specific class instead
......
...@@ -5976,7 +5976,11 @@ def gated_unit_layer(input, ...@@ -5976,7 +5976,11 @@ def gated_unit_layer(input,
@layer_support() @layer_support()
@wrap_name_default('switch_order') @wrap_name_default('switch_order')
def switch_order_layer(input, name=None, reshape=None, layer_attr=None): def switch_order_layer(input,
name=None,
reshape=None,
act=None,
layer_attr=None):
""" """
This layer switch dimension order of image input. This layer switch dimension order of image input.
From order "batchSize, channels, height, width" From order "batchSize, channels, height, width"
...@@ -6000,9 +6004,10 @@ def switch_order_layer(input, name=None, reshape=None, layer_attr=None): ...@@ -6000,9 +6004,10 @@ def switch_order_layer(input, name=None, reshape=None, layer_attr=None):
assert isinstance(input, LayerOutput) assert isinstance(input, LayerOutput)
l = Layer( l = Layer(
name=name, name=name,
inputs=input, inputs=input.name,
reshape=reshape, reshape=reshape,
type=LayerType.SWITCH_ORDER_LAYER, type=LayerType.SWITCH_ORDER_LAYER,
active_type=act.name,
**ExtraLayerAttribute.to_kwargs(layer_attr)) **ExtraLayerAttribute.to_kwargs(layer_attr))
return LayerOutput( return LayerOutput(
name=name, name=name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册