MCPcopy Create free account
hub / github.com/VisionXLab/OF-Diff / __init__

Method __init__

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

Source from the content-addressed store, hash-verified

158
159class AttnBlock(nn.Module):
160 def __init__(self, in_channels):
161 super().__init__()
162 self.in_channels = in_channels
163
164 self.norm = Normalize(in_channels)
165 self.q = torch.nn.Conv2d(in_channels,
166 in_channels,
167 kernel_size=1,
168 stride=1,
169 padding=0)
170 self.k = torch.nn.Conv2d(in_channels,
171 in_channels,
172 kernel_size=1,
173 stride=1,
174 padding=0)
175 self.v = torch.nn.Conv2d(in_channels,
176 in_channels,
177 kernel_size=1,
178 stride=1,
179 padding=0)
180 self.proj_out = torch.nn.Conv2d(in_channels,
181 in_channels,
182 kernel_size=1,
183 stride=1,
184 padding=0)
185
186 def forward(self, x):
187 h_ = x

Callers

nothing calls this directly

Calls 2

NormalizeFunction · 0.70
__init__Method · 0.45

Tested by

no test coverage detected