(self, hidden_states_a, hidden_states_b, temb, image_rotary_emb, attn_mask=None, ipadapter_kwargs_list=None)
| 244 | |
| 245 | |
| 246 | def forward(self, hidden_states_a, hidden_states_b, temb, image_rotary_emb, attn_mask=None, ipadapter_kwargs_list=None): |
| 247 | residual = hidden_states_a |
| 248 | norm_hidden_states, gate = self.norm(hidden_states_a, emb=temb) |
| 249 | hidden_states_a = self.to_qkv_mlp(norm_hidden_states) |
| 250 | attn_output, mlp_hidden_states = hidden_states_a[:, :, :self.dim * 3], hidden_states_a[:, :, self.dim * 3:] |
| 251 | |
| 252 | attn_output = self.process_attention(attn_output, image_rotary_emb, attn_mask, ipadapter_kwargs_list) |
| 253 | mlp_hidden_states = torch.nn.functional.gelu(mlp_hidden_states, approximate="tanh") |
| 254 | |
| 255 | hidden_states_a = torch.cat([attn_output, mlp_hidden_states], dim=2) |
| 256 | hidden_states_a = gate.unsqueeze(1) * self.proj_out(hidden_states_a) |
| 257 | hidden_states_a = residual + hidden_states_a |
| 258 | |
| 259 | return hidden_states_a, hidden_states_b |
| 260 | |
| 261 | |
| 262 |
nothing calls this directly
no test coverage detected