From e52f2bc53774a4ac8c02b9a11f969c8a5b0cf604 Mon Sep 17 00:00:00 2001 From: yuxiaodianyu <dengzhuo6@huawei.com> Date: Tue, 12 Jul 2022 09:50:47 +0800 Subject: [PATCH] modify network RCAN scripts --- research/cv/RCAN/src/rcan_model.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/research/cv/RCAN/src/rcan_model.py b/research/cv/RCAN/src/rcan_model.py index 0fd502076..6ffbf6680 100644 --- a/research/cv/RCAN/src/rcan_model.py +++ b/research/cv/RCAN/src/rcan_model.py @@ -86,11 +86,12 @@ class Upsampler(nn.Cell): """rcan""" super(Upsampler, self).__init__() m = [] - if (scale & (scale - 1)) == 0: - for _ in range(int(math.log(scale, 2))): - m.append(SmallUpSampler(conv, 2, n_feats, has_bias=has_bias)) - elif scale == 3: - m.append(SmallUpSampler(conv, 3, n_feats, has_bias=has_bias)) + for s in scale: + if (s & (s - 1)) == 0: + for _ in range(int(math.log(s, 2))): + m.append(SmallUpSampler(conv, 2, n_feats, has_bias=has_bias)) + elif s == 3: + m.append(SmallUpSampler(conv, 3, n_feats, has_bias=has_bias)) self.net = nn.SequentialCell(m) def construct(self, x): -- GitLab