Skip to content
Snippets Groups Projects
Commit e52f2bc5 authored by yuxiaodianyu's avatar yuxiaodianyu
Browse files

modify network RCAN scripts

parent 062046e0
Branches
No related tags found
No related merge requests found
...@@ -86,10 +86,11 @@ class Upsampler(nn.Cell): ...@@ -86,10 +86,11 @@ class Upsampler(nn.Cell):
"""rcan""" """rcan"""
super(Upsampler, self).__init__() super(Upsampler, self).__init__()
m = [] m = []
if (scale & (scale - 1)) == 0: for s in scale:
for _ in range(int(math.log(scale, 2))): if (s & (s - 1)) == 0:
for _ in range(int(math.log(s, 2))):
m.append(SmallUpSampler(conv, 2, n_feats, has_bias=has_bias)) m.append(SmallUpSampler(conv, 2, n_feats, has_bias=has_bias))
elif scale == 3: elif s == 3:
m.append(SmallUpSampler(conv, 3, n_feats, has_bias=has_bias)) m.append(SmallUpSampler(conv, 3, n_feats, has_bias=has_bias))
self.net = nn.SequentialCell(m) self.net = nn.SequentialCell(m)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment