def METHOD_NAME(self, blocks, x):
    h = x
    for l, (layer, block) in enumerate(zip(self.layers, blocks)):
        h = layer(block, h)
        if l < len(self.layers) - 1:
            h = h.flatten(1)
    h = h.mean(1)
    return h.log_softmax(dim=-1)