@@ -6438,6 +6438,8 @@ def prelu_layer(input,
6438
6438
- channel_shared = True, we set the partial_sum to the number of outputs.
6439
6439
- channel_shared = False, we set the partial_sum to the number of elements in one channel.
6440
6440
:type channel_shared: bool
6441
+ :param num_channels: number of input channel.
6442
+ :type num_channels: int
6441
6443
:param param_attr: The parameter attribute. See ParameterAttribute for details.
6442
6444
:type param_attr: ParameterAttribute
6443
6445
:param layer_attr: The extra layer attribute. See ExtraLayerAttribute for
@@ -6455,11 +6457,14 @@ def prelu_layer(input,
6455
6457
assert isinstance (param_attr , ParameterAttribute )
6456
6458
6457
6459
if num_channels is None :
6458
- assert input .num_filters is not None
6460
+ assert input .num_filters is not None , \
6461
+ 'the input channel cannot be detected, please specify the num_channels parameter'
6459
6462
num_channels = input .num_filters
6460
6463
6461
6464
if channel_shared is not None :
6462
6465
assert isinstance (channel_shared , bool )
6466
+ assert (input .height != 0 and input .width != 0 ), \
6467
+ 'input height and widht must be setted'
6463
6468
if channel_shared :
6464
6469
partial_sum = input .height * input .width * num_channels
6465
6470
else :
0 commit comments