def forward(self, x): N = x.data.size(0) C = x.data.size(1) H = x.data.size(2) W = x.data.size(3) x = F.avg_pool2d(x, (H, W)) x = x.view(N, C) return x # for route and shortcut