def forward(self,x):
x = self.base(x)
x = F.avg_pool2d(x,x.size()[2:])
f = x.view(x.size(0),-1)
clf_outputs = {}
for i in range(self.num_fcs):
clf_outputs["fc%d" % i] = getattr(self, "fc%d" % i)(f)
clf_outputs["y"] = self.classifier(f)
return clf_outputs
1 Like