MCPcopy Create free account
hub / github.com/Gadersd/stable-diffusion-burn / __call__

Method __call__

python/dump.py:94–108  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

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
110class Encoder:
111 def __init__(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected