MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / forward

Method forward

diffsynth/models/svd_vae_decoder.py:56–68  ·  view source on GitHub ↗
(self, hidden_states, time_emb, text_emb, res_stack, **kwargs)

Source from the content-addressed store, hash-verified

54 self.mix_factor = torch.nn.Parameter(torch.Tensor([0.5]))
55
56 def forward(self, hidden_states, time_emb, text_emb, res_stack, **kwargs):
57 x_spatial = hidden_states
58 x = rearrange(hidden_states, "T C H W -> 1 C T H W")
59 x = self.norm1(x)
60 x = self.nonlinearity(x)
61 x = self.conv1(x)
62 x = self.norm2(x)
63 x = self.nonlinearity(x)
64 x = self.conv2(x)
65 x_temporal = hidden_states + x[0].permute(1, 0, 2, 3)
66 alpha = torch.sigmoid(self.mix_factor)
67 hidden_states = alpha * x_temporal + (1 - alpha) * x_spatial
68 return hidden_states, time_emb, text_emb, res_stack
69
70
71class SVDVAEDecoder(torch.nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected