MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / forward

Method forward

models/nets/wrn.py:111–128  ·  view source on GitHub ↗
(self, x, ood_test=False)

Source from the content-addressed store, hash-verified

109 m.bias.data.zero_()
110
111 def forward(self, x, ood_test=False):
112 out = self.conv1(x)
113 out = self.block1(out)
114 out = self.block2(out)
115 out = self.block3(out)
116 out = self.relu(self.bn1(out))
117 out = F.adaptive_avg_pool2d(out, 1)
118 out = out.view(-1, self.channels)
119 output = self.fc(out)
120
121 if ood_test:
122 return output, out
123 else:
124 if self.is_remix:
125 rot_output = self.rot_classifier(out)
126 return output, rot_output
127 else:
128 return output
129
130
131class build_WideResNet:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected