MCPcopy Create free account
hub / github.com/MegaScenes/nvs / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

149
150class AttnBlock(nn.Module):
151 def __init__(self, in_channels):
152 super().__init__()
153 self.in_channels = in_channels
154
155 self.norm = Normalize(in_channels)
156 self.q = torch.nn.Conv2d(in_channels,
157 in_channels,
158 kernel_size=1,
159 stride=1,
160 padding=0)
161 self.k = torch.nn.Conv2d(in_channels,
162 in_channels,
163 kernel_size=1,
164 stride=1,
165 padding=0)
166 self.v = torch.nn.Conv2d(in_channels,
167 in_channels,
168 kernel_size=1,
169 stride=1,
170 padding=0)
171 self.proj_out = torch.nn.Conv2d(in_channels,
172 in_channels,
173 kernel_size=1,
174 stride=1,
175 padding=0)
176
177
178 def forward(self, x):

Callers

nothing calls this directly

Calls 2

NormalizeFunction · 0.70
__init__Method · 0.45

Tested by

no test coverage detected