From 8d16077ef3328d3a4e6ecbcb07595773b9471e7a Mon Sep 17 00:00:00 2001 From: littletomatodonkey <2120160898@bit.edu.cn> Date: Wed, 16 Dec 2020 19:02:28 +0800 Subject: [PATCH] fix resnest (#491) --- ppcls/modeling/architectures/resnest.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ppcls/modeling/architectures/resnest.py b/ppcls/modeling/architectures/resnest.py index 769b7637..0875c06a 100644 --- a/ppcls/modeling/architectures/resnest.py +++ b/ppcls/modeling/architectures/resnest.py @@ -165,14 +165,15 @@ class SplatConv(nn.Layer): atten = self.conv3(gap) atten = self.rsoftmax(atten) - atten = paddle.reshape(x=atten, shape=[-1, atten.shape[1], 1, 1]) if self.radix > 1: attens = paddle.split(atten, num_or_sections=self.radix, axis=1) - y = paddle.add_n( - [split * att for (att, split) in zip(attens, splited)]) + y = paddle.add_n([ + paddle.multiply(split, att) + for (att, split) in zip(attens, splited) + ]) else: - y = x * atten + y = paddle.multiply(x, atten) return y -- GitLab