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

Method forward

diffsynth/models/sd3_dit.py:185–193  ·  view source on GitHub ↗
(self, hidden_states_a)

Source from the content-addressed store, hash-verified

183
184
185 def forward(self, hidden_states_a):
186 batch_size = hidden_states_a.shape[0]
187 q, k, v = self.process_qkv(hidden_states_a, self.a_to_qkv, self.norm_q_a, self.norm_k_a)
188
189 hidden_states = torch.nn.functional.scaled_dot_product_attention(q, k, v)
190 hidden_states = hidden_states.transpose(1, 2).reshape(batch_size, -1, self.num_heads * self.head_dim)
191 hidden_states = hidden_states.to(q.dtype)
192 hidden_states = self.a_to_out(hidden_states)
193 return hidden_states
194
195
196

Callers

nothing calls this directly

Calls 2

process_qkvMethod · 0.95
toMethod · 0.45

Tested by

no test coverage detected