(self, hidden_states: torch.FloatTensor)
| 391 | self.gelu_2 = nn.GELU() |
| 392 | |
| 393 | def forward(self, hidden_states: torch.FloatTensor) -> torch.FloatTensor: |
| 394 | residual = self.conv_skip(hidden_states) if self.has_conv_skip else hidden_states |
| 395 | |
| 396 | hidden_states = self.conv_1(hidden_states) |
| 397 | hidden_states = self.group_norm_1(hidden_states) |
| 398 | hidden_states = self.gelu_1(hidden_states) |
| 399 | hidden_states = self.conv_2(hidden_states) |
| 400 | |
| 401 | if not self.is_last: |
| 402 | hidden_states = self.group_norm_2(hidden_states) |
| 403 | hidden_states = self.gelu_2(hidden_states) |
| 404 | |
| 405 | output = hidden_states + residual |
| 406 | return output |
| 407 | |
| 408 | |
| 409 | class UNetMidBlock1D(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected