MCPcopy Create free account
hub / github.com/IceClear/StableSR / __init__

Method __init__

ldm/modules/diffusionmodules/model.py:189–213  ·  view source on GitHub ↗
(self, in_channels)

Source from the content-addressed store, hash-verified

187
188class AttnBlock(nn.Module):
189 def __init__(self, in_channels):
190 super().__init__()
191 self.in_channels = in_channels
192
193 self.norm = Normalize(in_channels)
194 self.q = torch.nn.Conv2d(in_channels,
195 in_channels,
196 kernel_size=1,
197 stride=1,
198 padding=0)
199 self.k = torch.nn.Conv2d(in_channels,
200 in_channels,
201 kernel_size=1,
202 stride=1,
203 padding=0)
204 self.v = torch.nn.Conv2d(in_channels,
205 in_channels,
206 kernel_size=1,
207 stride=1,
208 padding=0)
209 self.proj_out = torch.nn.Conv2d(in_channels,
210 in_channels,
211 kernel_size=1,
212 stride=1,
213 padding=0)
214
215
216 def forward(self, x):

Callers

nothing calls this directly

Calls 2

NormalizeFunction · 0.70
__init__Method · 0.45

Tested by

no test coverage detected