提交 50764480 编写于 作者: C caoying03

follow comments.

上级 c7483bf9
...@@ -443,7 +443,7 @@ eos ...@@ -443,7 +443,7 @@ eos
:noindex: :noindex:
Activation with learnable parameter Activation with learnable parameter
=================== ===================================
prelu prelu
-------- --------
......
...@@ -5595,24 +5595,13 @@ def prelu_layer(input, ...@@ -5595,24 +5595,13 @@ def prelu_layer(input,
:rtype: LayerOutput :rtype: LayerOutput
""" """
if isinstance(input, collections.Sequence): assert isinstance(input, LayerOutput), 'prelu_layer only accepts one input'
assert len(input) == 1, 'prelu_layer only accepts one input' assert isinstance(param_attr, ParameterAttribute)
else:
input = [input]
assert isinstance(input[0], LayerOutput)
if isinstance(param_attr, collections.Sequence):
assert len(param_attr) == 1, (
'because prelu_layer only accepts one input '
'it requires only one parameter setting.')
else:
param_attr = [param_attr]
assert isinstance(param_attr[0], ParameterAttribute)
l = Layer( l = Layer(
name=name, name=name,
type='prelu', type='prelu',
inputs=Input(input[0].name, **param_attr[0].attr), inputs=Input(input.name, **param_attr.attr),
partial_sum=partial_sum, partial_sum=partial_sum,
**ExtraLayerAttribute.to_kwargs(layer_attr)) **ExtraLayerAttribute.to_kwargs(layer_attr))
return LayerOutput( return LayerOutput(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册