(self, hidden_states: torch.Tensor, num_frames: int = 1)
| 521 | nn.init.zeros_(self.conv4[-1].bias) |
| 522 | |
| 523 | def forward(self, hidden_states: torch.Tensor, num_frames: int = 1) -> torch.Tensor: |
| 524 | hidden_states = ( |
| 525 | hidden_states[None, :].reshape((-1, num_frames) + hidden_states.shape[1:]).permute(0, 2, 1, 3, 4) |
| 526 | ) |
| 527 | |
| 528 | identity = hidden_states |
| 529 | hidden_states = self.conv1(hidden_states) |
| 530 | hidden_states = self.conv2(hidden_states) |
| 531 | hidden_states = self.conv3(hidden_states) |
| 532 | hidden_states = self.conv4(hidden_states) |
| 533 | |
| 534 | hidden_states = identity + hidden_states |
| 535 | |
| 536 | hidden_states = hidden_states.permute(0, 2, 1, 3, 4).reshape( |
| 537 | (hidden_states.shape[0] * hidden_states.shape[2], -1) + hidden_states.shape[3:] |
| 538 | ) |
| 539 | return hidden_states |
| 540 | |
| 541 | |
| 542 | class TemporalResnetBlock(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected