(self, hidden_states, time_emb, text_emb, res_stack, **kwargs)
| 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 | |
| 71 | class SVDVAEDecoder(torch.nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected