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

Method forward

diffsynth/models/sd_vae_decoder.py:27–41  ·  view source on GitHub ↗
(self, hidden_states, time_emb, text_emb, res_stack)

Source from the content-addressed store, hash-verified

25 ])
26
27 def forward(self, hidden_states, time_emb, text_emb, res_stack):
28 batch, _, height, width = hidden_states.shape
29 residual = hidden_states
30
31 hidden_states = self.norm(hidden_states)
32 inner_dim = hidden_states.shape[1]
33 hidden_states = hidden_states.permute(0, 2, 3, 1).reshape(batch, height * width, inner_dim)
34
35 for block in self.transformer_blocks:
36 hidden_states = block(hidden_states)
37
38 hidden_states = hidden_states.reshape(batch, height, width, inner_dim).permute(0, 3, 1, 2).contiguous()
39 hidden_states = hidden_states + residual
40
41 return hidden_states, time_emb, text_emb, res_stack
42
43
44class SDVAEDecoder(torch.nn.Module):

Callers

nothing calls this directly

Calls 1

normMethod · 0.80

Tested by

no test coverage detected