未验证 提交 0a79499c 编写于 作者: G Guoxia Wang 提交者: GitHub

fix prelu weight shape for NHWC of static mode (#38310)

上级 fabc058b
......@@ -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]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册