(self, x, intermediate=False)
| 77 | return nn.Sequential(*layers) |
| 78 | |
| 79 | def forward(self, x, intermediate=False): |
| 80 | out0 = F.relu(self.bn1(self.conv1(x))) |
| 81 | out1 = self.layer1(out0) |
| 82 | out2 = self.layer2(out1) |
| 83 | out3 = self.layer3(out2) |
| 84 | out = F.avg_pool2d(out3, 4) |
| 85 | out = self.avgpool(out) |
| 86 | e1 = out.view(out.size(0), -1) |
| 87 | if self.dropout: |
| 88 | e1 = F.dropout(e1, p=0.5, training=True) |
| 89 | out = self.linear(e1) |
| 90 | |
| 91 | in_values = [out0, out1, out2, out3] |
| 92 | if intermediate==True: |
| 93 | return out, e1, in_values |
| 94 | else: |
| 95 | return out, e1 |
| 96 | |
| 97 | |
| 98 | def ShuffleNetG2(channels=3,num_classes=10, dropout=False): |
nothing calls this directly
no outgoing calls
no test coverage detected