(self, x)
| 78 | self.stride = stride |
| 79 | |
| 80 | def forward(self, x): |
| 81 | residual = x |
| 82 | |
| 83 | out = self.conv1(x) |
| 84 | out = self.bn1(out) |
| 85 | out = self.relu(out) |
| 86 | |
| 87 | out = self.conv2(out) |
| 88 | out = self.bn2(out) |
| 89 | out = self.relu(out) |
| 90 | |
| 91 | out = self.conv3(out) |
| 92 | out = self.bn3(out) |
| 93 | |
| 94 | if self.downsample is not None: |
| 95 | residual = self.downsample(x) |
| 96 | |
| 97 | out += residual |
| 98 | out = self.relu(out) |
| 99 | |
| 100 | return out |
| 101 | |
| 102 | |
| 103 | class ResNet(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected