Initialize ResidualBlock.
(self, residual: nn.Module, shortcut: nn.Module | None = None)
| 58 | """ |
| 59 | |
| 60 | def __init__(self, residual: nn.Module, shortcut: nn.Module | None = None) -> None: |
| 61 | """Initialize ResidualBlock.""" |
| 62 | super().__init__() |
| 63 | self.residual = residual |
| 64 | self.shortcut = shortcut |
| 65 | |
| 66 | def forward(self, x: torch.Tensor) -> torch.Tensor: |
| 67 | """Apply residual block.""" |