You mean this ?
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["y1"] = self.fc0(f)
        clf_outputs=["y2"] = self.fc1(f)
        l = (y1+y2)/2

        if self.loss == {'xent'}:
            return l
        elif self.loss == {'xent','htri'}:
            return l,f
        elif self.loss == {'cent'}:
            return l,f
        else:
            raise KeyError("Unsupported loss:{}".format(self.loss))
        l.backward()
        return clf_outputs