Skip to content
Snippets Groups Projects
Unverified Commit e7180a87 authored by i-robot's avatar i-robot Committed by Gitee
Browse files

!3105 modify RCAN scripts

Merge pull request !3105 from 邓卓/modify-networks
parents 8f737375 e52f2bc5
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment