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

Method forward

models/nets/wrn_var.py:114–132  ·  view source on GitHub ↗
(self, x, ood_test=False)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected