MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / forward

Method forward

diffusers/scripts/convert_consistency_decoder.py:318–333  ·  view source on GitHub ↗
(self, x, t)

Source from the content-addressed store, hash-verified

316 self.f_2 = nn.Conv2d(in_channels, in_channels, kernel_size=3, padding=1)
317
318 def forward(self, x, t) -> torch.Tensor:
319 x_skip = x
320
321 t = self.f_t(F.silu(t))
322 t_1, t_2 = t.chunk(2, dim=1)
323 t_1 = t_1.unsqueeze(2).unsqueeze(3) + 1
324 t_2 = t_2.unsqueeze(2).unsqueeze(3)
325
326 gn_1 = F.silu(self.gn_1(x))
327 upsample = F.upsample_nearest(gn_1, scale_factor=2)
328 f_1 = self.f_1(upsample)
329 gn_2 = self.gn_2(f_1)
330
331 f_2 = self.f_2(F.silu(t_2 + (t_1 * gn_2)))
332
333 return f_2 + F.upsample_nearest(x_skip, scale_factor=2)
334
335
336class ConvUNetVAE(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected