Skip to content

Commit

Permalink
fix prelu weight shape for NHWC of static mode (#38310)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoxiaWang authored Dec 22, 2021
1 parent fabc058 commit 0a79499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/paddle/fluid/layers/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9864,7 +9864,7 @@ def prelu(x, mode, param_attr=None, data_format="NCHW", name=None):
#NOTE(zhiqiu): Revert shape to [1, channel, 1, 1] for compatibility with saved model of old version.
#NOTE(GuoxiaWang): support NHWC data format
if data_format == 'NHWC':
alpha_shape = [1, 1, 1, x.shape[1]]
alpha_shape = [1, 1, 1, x.shape[-1]]
else:
alpha_shape = [1, x.shape[1], 1, 1]

Expand Down

0 comments on commit 0a79499

Please sign in to comment.