提交 50764480 编写于 作者: C caoying03

follow comments.

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