(self, x)
| 14 | self.downsample = downsample |
| 15 | |
| 16 | def forward(self, x): |
| 17 | identity = x |
| 18 | |
| 19 | out = self.conv1(x) |
| 20 | out = self.bn1(out) |
| 21 | out = self.relu(out) |
| 22 | |
| 23 | out = self.conv2(out) |
| 24 | out = self.bn2(out) |
| 25 | |
| 26 | if self.downsample is not None: |
| 27 | identity = self.downsample(x) |
| 28 | |
| 29 | out += identity |
| 30 | out = self.relu(out) |
| 31 | |
| 32 | return out |
| 33 | |
| 34 | class ResNet(nn.Module): |
| 35 | def __init__(self, block, layers, num_classes=1000, in_channels=3): |
nothing calls this directly
no outgoing calls
no test coverage detected