(self, x)
| 92 | self.conv_out = Conv2d(128, 3, 3, padding=1) |
| 93 | |
| 94 | def __call__(self, x): |
| 95 | x = self.conv_in(x) |
| 96 | x = self.mid(x) |
| 97 | |
| 98 | for l in self.up[::-1]: |
| 99 | for b in l['block']: |
| 100 | x = b(x) |
| 101 | if 'upsample' in l: |
| 102 | # https://pytorch.org/docs/stable/generated/torch.nn.functional.interpolate.html ? |
| 103 | bs,c,py,px = x.shape |
| 104 | x = x.reshape(bs, c, py, 1, px, 1).expand(bs, c, py, 2, px, 2).reshape(bs, c, py*2, px*2) |
| 105 | x = l['upsample']['conv'](x) |
| 106 | x.realize() |
| 107 | |
| 108 | return self.conv_out(self.norm_out(x).swish()) |
| 109 | |
| 110 | class Encoder: |
| 111 | def __init__(self): |
nothing calls this directly
no outgoing calls
no test coverage detected