(self)
| 75 | |
| 76 | class Decoder: |
| 77 | def __init__(self): |
| 78 | sz = [(128, 256), (256, 512), (512, 512), (512, 512)] |
| 79 | self.conv_in = Conv2d(4,512,3, padding=1) |
| 80 | self.mid = Mid(512) |
| 81 | |
| 82 | arr = [] |
| 83 | for i,s in enumerate(sz): |
| 84 | arr.append({"block": |
| 85 | [ResnetBlock(s[1], s[0]), |
| 86 | ResnetBlock(s[0], s[0]), |
| 87 | ResnetBlock(s[0], s[0])]}) |
| 88 | if i != 0: arr[-1]['upsample'] = {"conv": Conv2d(s[0], s[0], 3, padding=1)} |
| 89 | self.up = arr |
| 90 | |
| 91 | self.norm_out = GroupNorm(32, 128) |
| 92 | self.conv_out = Conv2d(128, 3, 3, padding=1) |
| 93 | |
| 94 | def __call__(self, x): |
| 95 | x = self.conv_in(x) |
nothing calls this directly
no test coverage detected